6. Software Engineering

Requirements

Teach eliciting, specifying and validating functional and non-functional requirements including use cases and user stories for clarity.

Requirements

Welcome to this essential lesson on requirements engineering, students! šŸš€ In this lesson, you'll discover how software developers figure out exactly what a system needs to do before they start building it. We'll explore the fascinating world of functional and non-functional requirements, learn how to gather them effectively, and understand why getting requirements right is crucial for successful software projects. By the end of this lesson, you'll be able to distinguish between different types of requirements, understand various elicitation techniques, and appreciate how use cases and user stories help clarify what users actually need from a system.

Understanding Requirements: The Foundation of Software Success

Think of requirements as the blueprint for a house - you wouldn't start building without knowing how many rooms you need, where the kitchen should go, or what style you want! šŸ  In software development, requirements serve the same purpose. They're detailed descriptions of what a system must do and how well it must perform.

Functional requirements describe what the system should do - the specific functions, features, and behaviors it must provide. These are like the rooms in your house blueprint: "The system must allow users to log in with a username and password" or "The online store must calculate shipping costs based on weight and destination." Every functional requirement represents a specific service or function the system must deliver to its users.

Non-functional requirements, on the other hand, describe how well the system should perform its functions. These are like specifying that your house should withstand earthquakes, have good insulation, or look aesthetically pleasing. Examples include "The system must respond to user queries within 2 seconds" or "The application must be available 99.9% of the time." Non-functional requirements often relate to performance, security, usability, reliability, and scalability.

According to industry research, approximately 70% of software project failures can be traced back to poor requirements management. This statistic highlights why understanding requirements is so critical for any aspiring computer scientist! šŸ“Š

Requirements Elicitation: Discovering What Users Really Need

Requirements elicitation is the detective work of software engineering - it's about uncovering what stakeholders actually need, not just what they initially say they want! šŸ” This process involves various techniques to gather comprehensive and accurate requirements from different sources.

Interviews are one of the most effective elicitation techniques. Software analysts sit down with stakeholders - users, managers, customers - and ask detailed questions about their needs, current processes, and desired outcomes. For example, when developing a school management system, you might interview teachers about how they currently track attendance, what problems they face, and what features would make their job easier.

Questionnaires and surveys help gather information from larger groups of stakeholders efficiently. These are particularly useful when you need input from hundreds of potential users. Online retailers like Amazon constantly use surveys to understand customer preferences and identify new feature requirements.

Observation involves watching users perform their current tasks to identify pain points and opportunities for improvement. This technique often reveals requirements that users themselves might not think to mention. For instance, observing how students use library computers might reveal the need for automatic session timeouts or simplified printing processes.

Document analysis examines existing systems, procedures, and documentation to understand current workflows and identify requirements. This might involve studying user manuals, process flowcharts, or existing software specifications.

Prototyping creates early versions of the system to help stakeholders visualize and refine their requirements. Interactive prototypes can reveal missing requirements and clarify user expectations before full development begins.

Specifying Requirements: Use Cases and User Stories

Once you've gathered requirements, you need to document them clearly and precisely. This is where use cases and user stories become invaluable tools! ✨

Use cases provide detailed descriptions of how users interact with a system to accomplish specific goals. They follow a structured format that includes:

  • Actor: Who is using the system (e.g., "Student," "Teacher," "Administrator")
  • Goal: What the actor wants to achieve
  • Preconditions: What must be true before the use case begins
  • Main flow: Step-by-step description of the normal interaction
  • Alternative flows: What happens when things don't go as expected

For example, a "Login" use case might describe: "The student enters their username and password, the system validates the credentials, and if correct, displays the student dashboard. If incorrect, the system shows an error message and allows retry."

User stories offer a more concise, user-focused approach to capturing requirements. They follow the format: "As a [type of user], I want [some goal] so that [some reason]." This format keeps the focus on user value and business objectives.

Examples of user stories include:

  • "As a student, I want to view my grades online so that I can track my academic progress"
  • "As a teacher, I want to upload assignment files so that students can access them easily"
  • "As a librarian, I want to search for books by multiple criteria so that I can help students find resources quickly"

User stories are particularly popular in agile development environments because they're flexible, easy to understand, and encourage collaboration between developers and stakeholders.

Validation: Ensuring Requirements Are Right

Requirements validation is the quality control process that ensures your requirements are complete, consistent, and actually reflect what stakeholders need! šŸŽÆ This crucial step prevents costly mistakes and rework later in the development process.

Completeness checking ensures all necessary requirements have been captured. Validation teams review requirements against business objectives and user needs to identify gaps. For instance, if you're developing an e-commerce system, you need to verify that requirements cover not just product browsing and purchasing, but also returns, customer support, and payment security.

Consistency checking identifies conflicts between requirements. Sometimes different stakeholders request contradictory features, or functional requirements conflict with non-functional constraints. For example, a requirement for "instant search results" might conflict with a requirement for "comprehensive search across all databases."

Feasibility analysis determines whether requirements can actually be implemented within technical, time, and budget constraints. This might involve prototyping critical features or consulting with technical experts.

Stakeholder reviews involve presenting requirements back to users and customers for confirmation. This often reveals misunderstandings or missed requirements. Many successful projects use formal sign-off processes where stakeholders explicitly approve requirements before development begins.

Requirements traceability ensures each requirement can be traced back to a business need and forward to design and test cases. This helps validate that all requirements serve a genuine purpose and will be properly implemented and tested.

Conclusion

Requirements engineering forms the critical foundation of successful software development, students! We've explored how functional requirements define what systems must do, while non-functional requirements specify how well they must perform. Through various elicitation techniques like interviews, surveys, and observation, software teams discover user needs and translate them into clear specifications using use cases and user stories. The validation process ensures these requirements are complete, consistent, and feasible before development begins. Mastering these concepts will help you build software that truly meets user needs and delivers genuine value! šŸŽ‰

Study Notes

• Functional Requirements: Specify what the system must do (features, functions, behaviors)

• Non-functional Requirements: Specify how well the system must perform (performance, security, usability)

• Requirements Elicitation Techniques:

  • Interviews: One-on-one discussions with stakeholders
  • Questionnaires: Surveys for large groups
  • Observation: Watching current processes
  • Document analysis: Reviewing existing documentation
  • Prototyping: Creating early system versions

• Use Cases: Detailed descriptions of user-system interactions including actors, goals, preconditions, and flows

• User Stories: Concise format: "As a [user type], I want [goal] so that [reason]"

• Requirements Validation: Process ensuring requirements are complete, consistent, and feasible

• Validation Techniques: Completeness checking, consistency checking, feasibility analysis, stakeholder reviews, traceability

• Key Statistic: 70% of software project failures trace back to poor requirements management

• Requirements serve as blueprints: Like house plans, they guide the entire development process

Practice Quiz

5 questions to test your understanding

Requirements — AS-Level Computer Science | A-Warded