Unit II Software Verification
Unit II Software Verification
3. Non-functional requirements:
4. Implementation difficulties and limitations
The SRS writer(s) should not include design and implementation details. It
should be written in simple, clear and unambiguous language which may
be understandable to all developers and customers.
Characteristics and organization of SRS
document
• The SRS document acts as a contract between
the developer and customer.
• This document should have the following
characteristics as given in IEEE recommended
practice for software requirements
specifications (IEEE std. 830 – 1998) [IEEE98a]:
“Correct, unambiguous, complete, consistent
and ranked for importance and / or stability,
verifiable, modifiable, traceable.”
The general organization
of the SRS document
SRS document checklist
• The SRS document is reviewed by the testing person(s) by
using any verification method (like peer reviews,
walkthroughs, inspections, etc.).
• A checklist is a popular verification tool which consists of a
list of critical information content that a deliverable should
contain.
• A checklist may also look for duplicate information,
missing information, unclear information, wrong
information, etc. Checklists are used during reviewing and
may make reviews more structured and effective.
• An SRS document checklist should address the following
issues:
An SRS document checklist should address the following issues:
• Correctness
• Ambiguity
• Completeness
• Consistency
• Verifiability
• Modifiability
• Traceability
• Feasibility
A generic checklist
SOFTWARE DESIGN DESCRIPTION (SDD)
DOCUMENT VERIFICATION
• We prepare the SDD document from the SRS
document. Every requirement stated therein is
translated into design information required for
planning and implementation of a software
system
• Our objective is to partition the system into
separate units that can be considered,
implemented and changed independently.
• Two popular design techniques are function
oriented design and object oriented design.
• Our purpose is to prepare a quality document
that translates all requirements into design
entities along with its attributes.
• The verification process may be carried out many
times in order to improve the quality of the SDD.
• The SDD provides a bridge between software
requirements and implementation.
• Hence, strength of the bridge is the strength of
the final software system.
SDD document checklist
• The SDD document verification checklist may
provide opportunities to reviewers for
focusing on important areas of the design.
• The software design starts as a process for
translating requirements stated in the SRS
document in a user-oriented functional
design.
SOURCE CODE REVIEWS
• A source code review involves one or more reviewers
examining the source code and providing feedback to the
developers, both positive and negative.
• Reviewers should not be from the development team.
• Review the source code for syntax, standards defined,
readability and maintainability.
• Reviews will have a standard checklist as a guide for finding
common mistakes and to validate the source code against
established coding standards.
• The source code reviews always improve the quality and
find all types of faults.
Issues related to source code reviews
1. Always use meaningful variables.
2. Avoid confusing words in names. Do not abbreviate ‘Number’ to ‘No’; ‘Num’ is a
better choice.
3. Declare local variables and avoid global variables to the extent possible. Thus,
minimize the scope of variables.
4. Minimize the visibility of variables.
5. Do not overload variables with multiple meanings.
6. Define all variables with meaningful, consistent and clear names.
7. Do not unnecessarily declare variables.
8. Use comments to increase the readability of the source code.
9. Generally, comments should describe what the source code does and not how the
source code works.
10. Always update comments while changing the source code.
11. Use spaces and not TABS.
12. All divisors should be tested for zero or garbage value.
13. Always remove unused lines of the source code.
14. Minimize the module coupling and maximize the module strength.
15. File names should only contain A-Z, a-z, 0-9, ‘_’ and ‘.’.
16. The source code file names should be all lower case.
17. All loops, branches and logic constructs should be complete, correct
and properly nested and also avoid deep nesting.
18. Complex algorithms should be thoroughly explained.
19. The reasons for declaring static variables should be given.
20. Always ensure that loops iterate the correct number of times.
21. When memory is not required, it is essential to make it free.
22. Release all allocated memory and resources after the usage.
23. Stack space should be available for running a recursive function.
Generally, it is better to write iterative functions.
24. Do not reinvent the wheel. Use existing source code as much as
possible. However, do not over-rely on this source code during
testing. This portion should also be tested thoroughly.
Checklist for source code reviews
USER DOCUMENTATION VERIFICATION
• installation guide, beginner’s guide / tutorial, system
administration guide, etc. and these are known as user
manuals
• Some are prepared for internal purposes like SRS, SDD,
program listing, cross-reference listing, test suite, etc., and
are known as documentation manuals.
• The documents which are given to the customer are also
important for the overall success of the project.
• User documentation may be provided as a user manual in
electronic form, as a printed booklet, or in the form of
online help.
User Documentation Checklist
SOFTWARE PROJECT AUDIT
• Audit of a software project is a very important
activity and may be carried out at any time
during the software development life cycle.
• Generally, auditors are appointed by the top
management to review the progress of the
project.
• The auditors are different from the developers
and testers and may not have any involvement
in the project.
• They may examine the progress of the project
and quality of the processes with respect to
many attributes like
• project planning, management, quality
management, resourcing, users, development
approaches, testing, application architecture,
data architecture and technical architecture.
• The audit process is a verification activity and
the auditor prepares an audited report after
examining the relevant records and
documents.
• This report may help the management to initiate
timely action, if required.
• The management may get to know about delays, if
any, in the development, involvement of users,
implementation of software engineering practices and
standards, status of risk assessment activities, etc.
• A project audit and review checklist has been
developed by Hetty Baiz and Nancy Costa at Princeton
University [HETT01] which is an excellent work for
auditing any software project.
1. Relevance Scale
• A relevance scale has been given in project
audit and review checklist to measure the
relevance of any attribute at the time of
auditing the project
Theory and practice scale
Project audit and review checklist
Case Study
• University Registration System:
II. Creating Test Cases from requirements
and Use Cases
• We prepare ‘Software requirements and
specifications’ document to define and specify
user requirements.
• In the initial years of software development,
requirement writers used to write stories to
explain the expected behaviour of the system
and its interactions with the external world.
• Ivar Jacobson and his team [JACO99] gave a new dimension
and direction to this area and developed a Unified Modeling
Language (UML) for software development.
• They introduced use case approach for requirements
elicitation and modeling.
• This is a more formal way to write requirements.
• The customer knows what to expect, the developer
understands what to code, the technical writer comprehends
what to document and the tester gets what to test.
• The use cases address primarily the functional
requirements, meaning thereby, the perspective of the users
sitting outside the system.
• Use cases capture the expectations in terms of achieving
goals and interactions of the users with the system.
USE CASE DIAGRAM AND USE CASES
• Use case diagram is also used along with use
cases to explain the functionality of the system.
• This is a graphical representation and gives the
top view of the system along with its users and
use cases.
• Use cases and use case diagrams are normally
used together to define the behaviour of a
system.
• A use case diagram visually explains what
happens when an actor interacts with the
system.
• Actor represents the role of a user that
interacts with the system. They are outsiders
to the system and can be human beings, other
systems, devices, etc.
• A use case is started by a user for a specific
purpose and completes when that purpose is
satisfied. It describes a sequence of actions a
system performs to produce an observable
output for the interacting user (actor).
• A use case describes who (any user) does what
(interaction) with the system, for what goal,
without considering the internal details of the
system. A complete set of use cases explains the
various ways to use the system. Hence, use cases
define expected behaviours of the system and
helps us to define the scope of the system.
Identification of Actors
• An actor represents the role of a user that interacts
with the system. An actor may be a human being
or a system that may interact with a use case
keeping in view a particular goal in mind
• University registration system
(i) Administrator
(ii) Student
(iii) Faculty
(iv) Data entry operator
(i) Administrator: Able to add, modify or delete a programme,
school, scheme, paper, student, faculty and login
information. Able to generate student registration card and
other reports.
(ii) Student: Able to add and modify his/her details and register
for papers to be studied in
the current semester. Able to generate student registration
card.
(iii) Faculty: Able to generate desired reports.
(iv) Data entry operator: Able to add, modify or delete student
and faculty information.
Identification of Use Cases
• After the finalization of requirements, we expect to create use
cases for the system. Some guidelines for the creation of use
cases are given as:
(i) Every use case should have a specified functionality.
(ii) Every use case will have a name. Every name should be unique,
meaningful and purposeful to avoid confusion in the system.
(iii) One or more actors will interact with a use case.
(iv) An actor will initiate a use case.
(v) The role of actors should always be clearly defined for every
use case. Who will initiate the use case and under which
conditions, should be clearly specified.
Drawing of Use Case Diagram
• The use case diagram shows actors, use cases
and the relationship between them.
• In use case diagram, actors are represented as
stick figures and
• Use cases are represented as ovals.
• The relationship between an actor and a use
case is represented by a solid arrow.
If the system is small, one diagram may be sufficient to
represent the whole system, but for
large systems, we may require to represent the whole
system in many diagrams.
Writing of Use Case Description
• Actors interact with the use cases for
predefined purposes. Hence, each actor does
something with the system and the system
responds accordingly.
• Each step is considered as a sequence of
events and is called a flow. There are two
types of flows:
(i) Basic Flow: It is the main flow and describes
the sequence of events that takes place most
of the time between the actor and the system
to achieve the purpose of the use case.
(ii) Alternative Flows: If the basic flow is not
successful due to any condition, the system
takes an alternative flow. An alternative flow
may occur due to failure of an expected service
because of occurrence of exceptions/errors.
GENERATION OF TEST CASES FROM USE
CASES
• We may start writing the test cases as soon as use cases
are available.
• A systematic approach may include the following steps:
(i) Generation of scenario diagrams
(ii) Creation of use case scenario matrix
(iii) Identification of variables in a use case
(iv) Identification of different input states of available
variables
(v) Design of test case matrix
(vi) Assigning actual values to variables
Generation of Scenario Diagrams
• A use case scenario is an instance of a use
case or a complete path through the use case
• The basic flow is one scenario and every
alternative path gives another scenario
• Use case scenarios may also be generated due
to various combinations of alternative flows.
• The basic flow is represented by a straight
arrow and the alternative flows by the curves
• Some alternative flows return to the basic
flow, while others end the use case.
• At the end of the basic flow, a post-condition
is generated while at the starting of the basic
flow, a pre-condition is required to be set.
• The basic and alternative flows for login use
case are given in Figure
• there is one basic flow which will be executed
when the correct login Id and password are
given. This basic flow is expected to be
executed most of the time.
• If any input (Login Id or password) is invalid,
then the alternative flow will be executed and
the actor will return to the beginning of the
basic flow. If at any time, the user decides to
exit, then alternative flow 3 will be executed.
Creation of Use Case Scenario Matrix