0% found this document useful (0 votes)
16 views16 pages

Static Testing Techniques Overview

The document discusses static testing techniques, specifically reviews of documents and code. It describes reviews as systematic examinations to find and remove errors before defects make it into executable code. Various review methods are covered, including desk checking, code walkthroughs, and formal inspections with assigned roles. Reviews are an important early testing activity that can improve productivity, reduce costs, and find defects earlier in the development cycle.

Uploaded by

Fahama Bin Ekram
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views16 pages

Static Testing Techniques Overview

The document discusses static testing techniques, specifically reviews of documents and code. It describes reviews as systematic examinations to find and remove errors before defects make it into executable code. Various review methods are covered, including desk checking, code walkthroughs, and formal inspections with assigned roles. Reviews are an important early testing activity that can improve productivity, reduce costs, and find defects earlier in the development cycle.

Uploaded by

Fahama Bin Ekram
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

Sir Syed University of Engineering & Technology, Karachi

CS-470
Software Quality Assurance & Testing
Week 16

Batch - 2017 Department of Computer Science 1


Static Testing
• Static testing techniques are those techniques that test software without
executing the code.
• This includes both the testing of work-products other than code, typically
requirements or specification documents, and the testing of code without
actually executing it.
• The first of these is known as a review and is typically used to find and remove
errors and ambiguities in documents before they are used in the development
process, thus reducing one source of defects in the code; the second is known as
static analysis, and it enables code to be analysed for structural defects or
systematic programming weaknesses that may lead to defects.
• Reviews are normally completed manually; static analysis is normally completed
automatically using tools.

2
REVIEWS AND THE TEST PROCESS
• A review is a systematic examination of a document by one or more people with
the main aim of finding and removing errors.
• Reviews can be used to test anything that is written or typed; this can include
documents such as requirement specifications, system designs, code, test plans
and test cases.
• Reviews represent the first form of testing that can take place during a software
development life cycle, since the documents reviewed are normally ready long
before the code has been written.
• The practice of testing specification documents by reviewing them early on in the
life cycle helps to identify defects before they become part of the executable
code, and so makes those defects cheaper and easier to remove.
• The same defect, if found during dynamic test execution, would incur the extra
cost of initially creating and testing the defective code, diagnosing the source of
the defect, correcting the problem and rewriting the code to eliminate the
defect.
• Reviewing code against development standards can also prevent defects from
appearing in test execution, though in this case, as the code has already been
written, not all the additional costs and delays are avoided.

3
… REVIEWS AND THE TEST PROCESS …
• Important as cost and time saving are, though, there are also other important
benefits of finding defects early in the life cycle, among them the following:
• Development productivity can be improved and timescales reduced because the
correction of defects in early work-products will help to ensure that those work-
products are clear and unambiguous.
• This should enable a developer to move more quickly through the process of
writing code.
• Also, if defects are removed before they become executable code there will be
fewer errors to find and fix during test execution.
• Testing costs and time can be reduced by removing the main delays in test
execution, which arise when defects are found after they have become failures
and the tester has to wait for a fix to be delivered.
• By reviewing the code and removing defects before they become failures the
tester can move more swiftly through test execution.
• Reductions in lifetime costs can be achieved because fewer defects in the final
software ensure that ongoing support costs will be lower.
• Improved communication results as authors and their peers discuss and refine
any ambiguous content discovered during review to ensure that all involved
understand exactly what is being delivered.
4
… REVIEWS AND THE TEST PROCESS
• The types of defects most typically found by reviews are:
– Deviations from standards either internally defined and managed or
regulatory/legally defined by Parliament or perhaps a trade organisation.
– Requirements defects – for example, the requirements are ambiguous, or
there are missing elements.
– Design defects – for example, the design does not match the requirements.
– Insufficient maintainability – for example, the code is too complex to
maintain.
– Incorrect interface specifications – for example, the interface specification
does not match the design or the receiving or sending interface.
– All reviews aim to find defects, but some types of review find certain types of
defects more effectively and efficiently than others.

5
Review Methods …
• The widely used methods are:
– Desk Checking
– Code walkthrough
– Formal Inspection

6
… Review Methods …
– Desk Checking:
• Is a method to verify the portions of the code for corrections.
• Such verification is done by comparing the code with the design or
specification to make sure that the code does what it is supposed to do
and effectively.
• This is the desk checking most programmers do before compiling and
executing the code.
• Whenever errors are found the author applies the corrections for errors
on the spot.
• This method of catching and correcting errors is characterized by:
– No structured method or formalism to ensure completeness and
– No maintaining of a log or checklist.

7
… Review Methods …
– Code walkthrough:
• This method is a group oriented method.
• Walkthroughs are less formal than inspections.
• The line drawn in formalism between walkthroughs and inspections is
very thin and varies from organization to organization.
• It brings multiple perspectives.
• A set of people look at the program code and raise questions for the
author.
• The author explains the logic of the code, and answers the questions.
• Completeness is limited to the area where questions are raised by the
team.

8
… Review Methods
– Formal Inspection:
• Is a method normally with high degree of formalism
• The focus of this method is to detect all faults, violations, and other side effects
• This method increases the number of defects detected v=by:
– Demanding through preparation before an inspection/review
– Enlisting multiple diverse reviews
– Assigning specific roles to the multiple participants
– Going sequentially through the code in a structured manner
• A formal inspection should take place only when the author has made sure the
code is ready for inspection by performing some basic desk checking and
walkthroughs.
• When the code is in such a reasonable state of readiness an inspection meeting is
arranged.
• There are four roles in inspection.
– First is the author of the code.
– Second is a moderator who is expected to formally run the inspection
according to the process.
– Third are the inspectors. These are the people who actually provides review
comments for the code. There are typically multiple inspectors.
– Finally there is a scribe who takes detailed notes during the inspection
meeting and circulates them to the inspection team after meeting.
9
Code Review - Checklist

Data Item Declaration Related

10
Code Review - Checklist

Data Usage Related

11
Code Review - Checklist
Control Flow Related

12
Code Review - Checklist

Standards Related

13
Code Review - Checklist

Style Related

14
Code Review - Checklist

Miscellaneous

15
Code Review - Checklist
Documentation Related

16

Common questions

Powered by AI

Static testing improves software development efficiency by identifying and removing defects early in the development process. By reviewing requirement specifications, system designs, and code without executing it, errors can be detected early, reducing the likelihood of complex defects later in the development cycle. This practice, particularly reviews, enhances clarity and reduces ambiguity, allowing developers to write code more quickly and with fewer errors . Additionally, by reducing defects before the code becomes executable, fewer errors need to be addressed during dynamic testing, thereby decreasing testing costs and time delays .

Code walkthroughs and formal inspections differ primarily in their level of formality and their structured approach. Walkthroughs are less formal and usually involve a group reviewing the code where multiple perspectives are considered, but only questions raised by the team are addressed, limiting completeness to those areas . Formal inspections, however, are highly structured and aim to detect all faults through thorough preparation, role assignments, and a methodical review process. Inspections demand more rigorous preparation and involve specific roles such as a moderator, inspectors, and a scribe to ensure comprehensive defect identification .

Reviewing specification documents early is crucial for defect prevention because it helps identify and correct ambiguities and errors before they propagate into later development stages as code. This early intervention decreases the chance of defects becoming embedded in executable code, which would be more costly and time-consuming to address. It also ensures that work products are clearer and unambiguous, streamlining subsequent development phases .

Completeness varies between desk checking and code walkthroughs. Desk checking is an informal process where programmers verify their code corrections against design specifications without any structured methods, potentially leading to overlooked errors due to lack of completeness and recording . In contrast, code walkthroughs, though still less formal than inspections, involve a group who look at the code together, ensuring more comprehensive coverage through varied perspectives, but completeness is limited to the questions raised during the session .

Formal inspections differ from other review methods in their rigorous focus on thoroughly detecting all possible faults, violations, and side effects in the code. They employ a structured method involving specific role assignments (author, moderator, inspectors, scribe) ensuring a comprehensive evaluation. In contrast, other review methods like desk checking and code walkthroughs have less structured approaches, making them more suitable for identifying straightforward or surface-level issues rather than systematically detecting all potential problems .

Reviews reduce delays in test execution phases by eliminating defects before code execution begins. This proactive defect detection prevents the need for delayed test corrections after failures occur, thus avoiding the time testers would spend waiting for fixes and retests. By ensuring a cleaner codebase, test execution can proceed more efficiently, with fewer interruptions due to defect remediation .

Reviews enhance communication among developers by facilitating discussions and collaborations on documents where ambiguity and errors may exist. This process helps clarify the authors’ intents and ensures all team members understand what is being developed. Through the review process, authors and peers refine ambiguous content, leading to improved documentation and aligning the team's understanding and expectations, thereby reducing potential misunderstandings later in the cycle .

The review process contributes to cost reduction by allowing defects to be detected and corrected early in the software development life cycle. This reduces the need for additional resources and time that would otherwise be required to address defects in executable code. Early detection through reviews mitigates delays in the test execution phase and ensures fewer failures, leading to decreased lifetime support costs for the final software product. Communicative clarity and refined documentation further reduce misunderstandings and associated costs .

Review processes typically identify defects such as deviations from standards, ambiguous or missing requirements, design flaws not aligning with requirements, insufficient maintainability due to complex code, and incorrect interface specifications. Different types of reviews, such as desk checking, code walkthroughs, and formal inspections, focus on finding these defects effectively and efficiently .

Conducting a formal inspection only when the code is ready is important because it ensures that the inspection process is as effective as possible. If the code is not in a reasonable state of readiness, with basic desk checking and walkthroughs already performed, formal inspections may miss certain defects or waste time reviewing incomplete sections. A prepared codebase allows inspectors to focus on identifying deeper structural issues, violations, and side effects rather than basic errors that should have been remedied earlier .

You might also like