Unit 3: Design and testing
Software Engineering notes · PTU syllabus (UGCC2514)
On this page
Unit summary
Design turns requirements into a blueprint for code, and testing checks that the code actually works. This unit covers design concepts and quality, software architecture, data design, the main UML diagrams, testing strategies, black-box and white-box testing, debugging, and product metrics.
After this unit you can
- Explain the design process, design concepts and quality attributes
- Draw and explain use case, class, sequence, collaboration and component diagrams
- Apply testing strategies and black-box and white-box techniques
- Use product metrics for analysis, design, code, testing and maintenance
PTU syllabus topics
- Design process and quality
- design concepts and model
- software architecture
- data design
- class/sequence/collaboration/use case/component diagrams
- testing strategies
- black-box and white-box testing
- validation and system testing
- debugging
- product metrics for analysis
- design
- source code
- testing and maintenance
- Acceptance testing
Users confirm it meets their needs
- System testing
The whole system against requirements
- Integration testing
Modules working together
- Unit testing
Individual functions or classes
Topic 1
Design process and design concepts
Design quality guidelines: a design should implement all requirements, be readable and understandable, and give a complete picture of data, functions and behaviour.
- Abstraction
- Focus on essentials, hide detail
- Architecture
- Overall structure of components
- Modularity
- Divide software into separately named modules
- Information hiding
- Modules hide internal details
- Functional independence
- High cohesion, low coupling
- Refinement
- Step-wise elaboration of detail
Exam tip
High cohesion (each module does one thing well) and low coupling (modules depend little on each other) is the mark of good design.
Topic 2
Software architecture and data design
Software architecture is the structure of a system: its components, their properties and relationships. Common styles: data-centred, data-flow (pipe and filter), call-and-return, layered, object-oriented and client-server. Data design turns the data model from analysis into data structures and database designs.
Topic 3
UML diagrams
| Diagram | Shows |
|---|---|
| Use case diagram | Actors and the functions (use cases) they use |
| Class diagram | Classes, attributes, operations and relationships |
| Sequence diagram | Messages between objects in time order |
| Collaboration (communication) diagram | Object interactions, focusing on links |
| Component diagram | Physical software components and their interfaces |
Example
Use case diagram for a library: actors Student and Librarian; use cases Search Book, Issue Book, Return Book, Pay Fine.
Topic 4
Testing strategies and techniques
- 1Unit testing
Individual modules
- 2Integration testing
Modules combined: top-down or bottom-up
- 3Validation testing
Against requirements: alpha and beta
- 4System testing
Recovery, security, stress, performance
Based on
Specifications
Internal code
Techniques
Equivalence partitioning, boundary value analysis
Basis path testing, statement and branch coverage
Done by
Testers, users
Developers
Finds
Missing or wrong functions
Logic and path errors
Cyclomatic complexity V(G) = E − N + 2 (edges − nodes + 2) gives the number of independent paths to test. Debugging finds and fixes the cause of a failure, using brute force, backtracking or cause elimination.
Topic 5
Product metrics
Metrics measure software quality: analysis model (function points), design model (coupling, cohesion, depth of inheritance), source code (LOC, Halstead metrics), testing (test coverage, defects found) and maintenance (Software Maturity Index).
Key terms
- Cohesion
- How closely the functions within a module belong together
- Coupling
- How much modules depend on each other
- Use case
- A sequence of actions giving a result to an actor
- Black-box testing
- Testing based on specifications, not code
- Cyclomatic complexity
- The number of independent paths in a program
Quick revision
- Good design: high cohesion, low coupling.
- UML: use case, class, sequence, collaboration, component.
- Unit → integration → validation → system testing.
- V(G) = E − N + 2.
Important exam questions
Practice questions written to the PTU exam pattern for this unit's syllabus: short answers (Section A style) and long answers (Sections B and C style).
Short-answer questions
- Q1.Differentiate between cohesion and coupling.
- Q2.What is information hiding?
- Q3.What does a sequence diagram show?
- Q4.Differentiate between black-box and white-box testing.
- Q5.What is boundary value analysis?
- Q6.Define cyclomatic complexity.
Long-answer questions
- Q1.Explain the fundamental design concepts in software engineering.
- Q2.Draw a use case diagram and a class diagram for an online shopping system.
- Q3.Explain software testing strategies from unit to system testing.
- Q4.Explain black-box and white-box testing techniques with examples.
Stuck on this unit?
Message SBS on WhatsApp for help with Software Engineering, or to ask about studying BCA at Synetic.
