0% found this document useful (0 votes)
7 views7 pages

Software Testing Assignment

The document discusses the importance of formal inspection methodologies for code reviews in mission-critical software systems, emphasizing structured processes, early defect detection, and diverse perspectives. It also outlines the ideal size and roles of a review team, including the moderator, author, presenter, recordkeeper, and reviewers. Additionally, it covers static unit testing techniques and the calculation of mutation scores to assess test suite effectiveness, suggesting that further test cases could enhance fault detection and confidence in the software's correctness.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views7 pages

Software Testing Assignment

The document discusses the importance of formal inspection methodologies for code reviews in mission-critical software systems, emphasizing structured processes, early defect detection, and diverse perspectives. It also outlines the ideal size and roles of a review team, including the moderator, author, presenter, recordkeeper, and reviewers. Additionally, it covers static unit testing techniques and the calculation of mutation scores to assess test suite effectiveness, suggesting that further test cases could enhance fault detection and confidence in the software's correctness.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

QUESTION 2)

For the mission-critical software system for launching missiles, a


formal inspection methodology would be the most suitable code
review approach compared to a walkthrough. Here's why:

 Structured and Thorough: Inspections follow a well-


defined process with designated roles and specific steps like
entry criteria, defect detection, and defect resolution. This
structure ensures a thorough and systematic review
 Early Defect Detection: Inspections emphasize defect
detection at an early stage, minimizing the cost and effort of
fixing issues later in the development cycle.
 Diverse Perspectives: Inspections typically involve a team
with diverse expertise, leading to a more comprehensive
review that considers various aspects of the code.
 Documented Results: Inspections produce documented
records of identified defects and their resolutions. This
documentation serves as a valuable audit trail and promotes
traceability in case of future issues.

Num 3)

For the critical missile launch system

 A focused review team of between 3-7 members is ideal


due to the following reasons

 Small and Efficient: This size allows for in-depth review


without getting bogged down in large discussions.
 Clear Ownership: Each reviewer has clear responsibility for
their part of the review.

Different roles of each member of the review


team
Moderator:
 A review meeting is chaired by the moderator.
 The moderator is a trained individual who guides the pace of the
review process.
 The moderator selects the reviewers and schedules the review
meetings.
 Myers suggests that the moderator be a member of a group from
an unrelated project to preserve objectivity
Author:
 This is the person who has written the code to be reviewed.
Presenter:
 A presenter is someone other than the author of the code.
 The presenter reads the code beforehand to understand it.
 It is the presenter who presents the author’s code in the review
meeting
Recordkeeper:
 The recordkeeper documents the problems found during the
review process and the follow-up actions suggested. The person
should be different than the author and the moderator
Reviewers:
 These are experts in the subject area of the code under review.

N0 5) OTHER STATIC UNIT TESTING


TECHNIQUES
Static Code Analysis: Scans code for errors, security flaws, and
adherence to coding standards without running it.
Automated Code Reviews: Checks code against predefined rules,
ensuring consistency and identifying common mistakes.

Code Metrics Analysis: Measures code complexity, coupling, and


change frequency to assess maintainability.

Dependency Analysis: Examines relationships between code


components, revealing issues like circular or outdated
dependencies.

Design and Architecture Analysis: Evaluates codebase structure


and alignment with architectural principles to ensure scalability
and maintainability.

Documentation Analysis: Validates documentation for accuracy,


completeness, and consistency in conveying project information.

QUESTION 8
Draw a control flow graph for the following sample code. Determine
the cyclomatic
complexity of the graph.
(a) sum_of_all_positive_numbers(a, num_of_entries, sum)
(b) sum = 0
(c) init = 1
(d) while(init <= num_of_entries)
(e) if a[init] > 0
(f) sum = sum + a[init]
endif
(g) init = init + 1
endwhile
(h) end sum_of_all_positive_numbers
CONTROL FLOW GRAPH FOR THE SAMPLE CODE

The cyclomatic complexity is given by:


 E-N+2P Where ,
 E is the number of edges
 N is the number of nodes, and
 P is the number of connected components (in this case, P=1).
 7−6+2(1) = 3, The cyclomatic complexity of the control flow graph
is 3.

Number 9)
Mutation Score Calculation:

 Total Mutants (M) = 70


 Dead Mutants (DM) = 58
 Equivalent Mutants (EM) = 4
 Mutation Score (MS) = (DM + EM) / M * 100
 MS = (58 + 4) / 70 * 100
 MS = 62 / 70 * 100
 MS ≈ 88.57%

Test Suite Adequacy:


There's no universal threshold to define an adequate test suite based
on mutation score alone. However, a higher mutation score generally
indicates a more effective test suite in exposing faults in the program.

In this case, the mutation score of 88.57% is considered relatively high.


It suggests the test suite is successful in killing a significant portion of
the mutants (almost 89%).

Should the Engineer Develop More Test Cases?


While the current score is good, developing additional test cases can
further improve the test suite's effectiveness.
Here's why:

Undetectable Mutants: The remaining 11.43% (100 - 88.57) of mutants


(8 out of 70) could represent faults the current test cases cannot
expose.

These undetected mutants might indicate weaknesses in the test suite's


ability to cover certain edge cases or logic flows.

Improved Fault Detection: More test cases can lead to a more


comprehensive test suite, potentially detecting even subtle faults that
the current set might miss.
Increased Confidence: A higher mutation score translates to greater
confidence in the program's correctness. Additional testing can provide
more evidence to support this confidence.

You might also like