CH05.L07 . White Box techniques

MaharaTech - ITI MOOCA
16 Apr 201704:26

Summary

TLDRThis script delves into white box testing, focusing on Statement and Decision techniques for software testing with visible source code. It illustrates how to achieve 100% statement coverage with the least test cases and emphasizes Decision testing for comprehensive code pathway exploration. The explanation includes practical examples, demonstrating the process of creating test cases and calculating coverage percentages. The script suggests that Decision testing generally requires more test cases for better code coverage and references 'A Practitioner's Guide to Software Test Design' for further insights.

Takeaways

  • 📘 White box testing involves examining the source code of software, allowing for detailed testing techniques.
  • 🔍 Two primary white box testing techniques discussed are Statement testing and Decision or branch testing.
  • 📊 Statement testing aims to execute all lines of code with the fewest test cases possible, ensuring code coverage.
  • 🛠️ Decision testing focuses on creating test cases that cover all possible outcomes of decision points in the code, such as if-else or while loops.
  • 📚 A control flow graph is a useful tool for visualizing the flow of a program, aiding in the application of these testing techniques.
  • 🚗 The first example demonstrates how selecting specific conditions (e.g., vehicle type and color) can achieve 100% statement coverage with a single test case.
  • 📈 To calculate coverage, divide the number of executed statements by the total number of statements, or executed decisions by the total number of decisions.
  • 🔄 The second example shows that statement coverage does not always require using all code lines and can be achieved with multiple test cases.
  • 🔢 In the second example, three test cases with varying conditions are needed to achieve 100% statement coverage, illustrating the complexity of some code structures.
  • 💡 The number of test cases required for Statement testing is generally less than or equal to those needed for Decision testing, highlighting the thoroughness of Decision testing.
  • 📚 For further reading on white box testing techniques, 'A Practitioner's Guide to Software Test Design' is recommended.

Q & A

  • What are white box testing techniques?

    -White box testing techniques are methods used when the tester has access to the source code of the software being tested. These techniques allow for a deeper understanding and testing of the internal workings of the software.

  • What are the two white box testing techniques discussed in the script?

    -The two white box testing techniques discussed are Statement testing and Decision or branch testing.

  • What is the goal of Statement testing?

    -The goal of Statement testing is to execute all the code lines or to review all of them using the least number of test cases possible.

  • How is 100% statement coverage achieved according to the script?

    -100% statement coverage is achieved when a single test case can execute all the statements in the code, ensuring that every line of code is tested.

  • What is Decision or branch testing?

    -Decision or branch testing is a technique aimed at writing test cases that cover all possible paths in the code, especially focusing on decision points such as if-then-else or while loops.

  • How many test cases are needed to achieve 100% decision coverage in the first example provided?

    -Three test cases are needed to achieve 100% decision coverage in the first example, each covering different branches of the decision points.

  • What is a control flow graph and how is it used in white box testing?

    -A control flow graph is a diagram that represents the flow of control in a program, showing decision points and the paths that can be taken. It is used in white box testing to visually plan test cases that cover all possible execution paths.

  • How is decision coverage calculated?

    -Decision coverage is calculated by dividing the number of executed decisions by the total number of decisions in the code.

  • What is the relationship between the number of test cases in Statement testing and Decision testing?

    -The number of test cases needed for Statement testing is always less than or equal to the number of test cases needed for Decision testing, as Decision testing aims to cover all possible paths, including all decisions.

  • Why is it not always necessary to use all code lines for 100% statement coverage in some cases?

    -In some cases, due to the structure of the code and decision points, it may be possible to achieve 100% statement coverage with fewer test cases than the total number of statements, as some paths may naturally cover multiple statements.

  • Which book is recommended for a good reference on white box testing techniques?

    -The book 'A Practitioner's Guide to Software Test Design' is recommended for a comprehensive understanding of white box testing techniques, including Statement and Branch testing.

Outlines

plate

このセクションは有料ユーザー限定です。 アクセスするには、アップグレードをお願いします。

今すぐアップグレード

Mindmap

plate

このセクションは有料ユーザー限定です。 アクセスするには、アップグレードをお願いします。

今すぐアップグレード

Keywords

plate

このセクションは有料ユーザー限定です。 アクセスするには、アップグレードをお願いします。

今すぐアップグレード

Highlights

plate

このセクションは有料ユーザー限定です。 アクセスするには、アップグレードをお願いします。

今すぐアップグレード

Transcripts

plate

このセクションは有料ユーザー限定です。 アクセスするには、アップグレードをお願いします。

今すぐアップグレード
Rate This

5.0 / 5 (0 votes)

関連タグ
White BoxTesting TechniquesStatement TestingDecision TestingCode CoverageSoftware QualityControl FlowTest CasesTest DesignPractical Guide
英語で要約が必要ですか?