CH05.L01 . Black box or white box testing

MaharaTech - ITI MOOCA
16 Apr 201702:58

Summary

TLDRThis script delves into the distinctions between Black Box and White Box Testing, highlighting their respective applications in software development. Black Box Testing, akin to 'specification-based testing', is used for functional and non-functional testing without considering the internal system structure, suitable for later stages like System and Acceptance Testing. In contrast, White Box Testing, known as 'structural-based' or 'glass box', involves examining the system's internal code, crucial for early stages such as Unit and Integration Testing. The script also emphasizes the importance of 'Test to pass' for validating minimum requirements and 'Test to fail' for uncovering software weaknesses, suggesting that practice and learning are key to effective test case development.

Takeaways

  • πŸ” Black Box Testing is used for functional and non-functional testing without considering the internal structure of the system.
  • πŸ“š Black Box Testing is based on specifications, where inputs are added and outputs are checked against expected results.
  • βœ… If the output matches the expected result in Black Box Testing, it's considered a 'pass'; otherwise, it's a 'fail'.
  • πŸ‘€ Black Box Testing is conducted from the perspective of an end user without technical background, focusing on the program's functionality.
  • 🏒 Black Box Testing is suitable for later testing stages such as System Testing and Acceptance Testing.
  • πŸ’Ό White Box Testing, also known as Structural Based Testing or Glass Box Testing, allows the tester to see the internal structure and requires access to the source code.
  • πŸ” White Box Testing focuses on the code structure, ensuring all paths, conditions, and statements are executed and checked for bugs.
  • πŸ”¨ White Box Testing is more suitable for initial testing levels like Unit Testing and Integration Testing.
  • πŸ“ Test cases can be written for two purposes: 'Test to pass' for the happy scenario and 'Test to fail' for the bad scenario.
  • πŸ’‘ 'Test to pass' aims to ensure the software meets its minimum requirements, simulating typical user behavior.
  • 🚨 'Test to fail' involves creating the most challenging scenarios to find software weaknesses and bugs, often requiring creative and destructive test cases.

Q & A

  • What is Black Box Testing?

    -Black Box Testing is a method of testing where the tester focuses on the functionality of the software without considering the internal structure or the source code. It is based on the software's specifications and is used to determine if the software behaves as expected when given specific inputs.

  • What is White Box Testing?

    -White Box Testing, also known as Structural Based Testing or Glass Box Testing, is a method where the tester has access to the internal structure of the software, including the source code. It focuses on the paths, conditions, and statements in the code to ensure that all parts of the code are executed and tested.

  • When is Black Box Testing typically used?

    -Black Box Testing is suitable for the later stages of testing, such as System Testing and Acceptance Testing. It is used when the tester wants to evaluate the software from the end user's perspective without needing to understand the internal workings of the software.

  • When is White Box Testing typically used?

    -White Box Testing is more suitable for the initial levels of testing, such as Unit Testing and Integration Testing. It is used when the tester needs to understand and test the logic and structure of the software code.

  • What is the purpose of Black Box Testing?

    -The purpose of Black Box Testing is to verify that the software meets its functional requirements as specified in the software specifications. It checks if the software produces the expected output when provided with specific inputs.

  • What is the purpose of White Box Testing?

    -The purpose of White Box Testing is to ensure that all paths and conditions in the software code are tested. It helps in identifying any untested code paths or conditions that might lead to bugs or errors.

  • What is meant by 'specification based testing' in the context of Black Box Testing?

    -'Specification based testing' refers to a testing approach where the test cases are designed based on the software's specifications. The tester does not need to look at the internal code but focuses on whether the software behaves as described in the specifications.

  • What is the significance of 'Structural based testing' in White Box Testing?

    -'Structural based testing' in White Box Testing means that the test cases are designed based on the structure of the software code. The tester checks if all code paths, conditions, and statements are executed as expected.

  • What are the two main reasons for writing test cases in any testing technique?

    -The two main reasons for writing test cases are to 'Test to pass' and 'Test to fail'. 'Test to pass' aims to ensure that the software meets its minimum requirements and behaves as expected under normal conditions. 'Test to fail' aims to identify the weaknesses in the software and find bugs by testing the software under extreme or unexpected conditions.

  • How does the approach to test case design differ between Black Box Testing and White Box Testing?

    -In Black Box Testing, test cases are designed from the perspective of an end user, focusing on the software's functionality and expected outcomes. In White Box Testing, test cases are designed based on the internal structure and logic of the software code, focusing on ensuring that all code paths and conditions are tested.

  • Why is it important to train, practice, and learn in testing techniques?

    -Training, practicing, and learning in testing techniques help testers to better understand how to write effective test cases for both 'Test to pass' and 'Test to fail' scenarios. This improves the quality of testing and helps in identifying more bugs and ensuring that the software meets its requirements.

Outlines

00:00

πŸ” Understanding Black Box and White Box Testing

This paragraph introduces the fundamental differences between Black Box Testing and White Box Testing. Black Box Testing is described as a 'specification-based testing' approach that focuses on the functionality and non-functionality of a system without considering its internal structure. It is suitable for later stages of testing such as System Testing and Acceptance Testing. In contrast, White Box Testing, also known as 'Structural based testing' or 'Glass box testing', involves examining the internal structure and source code of the system. This method is more suitable for initial testing levels like Unit Testing and Integration Testing. The paragraph also discusses the importance of writing test cases for both 'Test to pass' (Happy scenario) and 'Test to fail' (Bad scenario), emphasizing the need for thorough testing to ensure software reliability.

Mindmap

Keywords

πŸ’‘Black Box Testing

Black Box Testing is a method of software testing where the tester focuses on the functionality of the software without any knowledge of its internal structure. It is called 'black box' because the tester treats the system as a 'black box' that transforms inputs into outputs. In the video, it is mentioned as being suitable for the last testing levels such as System Testing and Acceptance Testing, emphasizing the 'specification based testing' approach where the program's execution is tested against its specification without looking at the code.

πŸ’‘White Box Testing

White Box Testing, also known as 'Structural based testing' or 'glass box testing', allows the tester to see the internal workings of the system, including the source code. It is focused on the code structure, ensuring all paths and conditions are tested. The video describes it as suitable for initial testing levels such as Unit Testing and Integration Testing, where the logic of the program is tested.

πŸ’‘Functional Testing

Functional Testing is a type of testing that checks if the software functions correctly according to its specifications. It is a part of Black Box Testing where the tester verifies the output against the expected results without considering the internal code. The video script uses the example of testing a program that adds numbers, where the focus is on whether the output matches the expected result.

πŸ’‘Non-Functional Testing

Non-Functional Testing evaluates the software's attributes that are not directly related to its functionality, such as performance, usability, and reliability. In the script, it is mentioned alongside Functional Testing as something that can be tested using Black Box Testing, without referring to the internal structure of the system.

πŸ’‘Specification Based Testing

Specification Based Testing is a testing approach where tests are designed based on the software's specifications. It is a key aspect of Black Box Testing, as mentioned in the video, where the tester adds inputs and checks if the output matches the expected results written in the specification, without needing to see the program's code.

πŸ’‘Structural Based Testing

Structural Based Testing is an approach where the test cases are designed based on the internal structure of the software, such as the code paths, conditions, and statements. It is a core concept of White Box Testing, as explained in the video, where the tester ensures that all parts of the code have been executed and checked for potential bugs.

πŸ’‘System Testing

System Testing is the process of testing a complete, integrated software system to evaluate its compliance with specified requirements. The video script mentions it as one of the last testing levels where Black Box Testing is applied to ensure the system functions as intended from an end-user perspective.

πŸ’‘Acceptance Testing

Acceptance Testing is performed to determine if the software is ready to be delivered to the end-user. It is often the final testing phase before deployment. The script highlights Acceptance Testing as a level where Black Box Testing is suitable to confirm that the software meets the user's needs and requirements.

πŸ’‘Unit Testing

Unit Testing is the process of testing individual components or units of a software to determine if they function correctly. The video script describes it as an initial testing level where White Box Testing is appropriate to ensure each unit of the code is tested for logic and execution.

πŸ’‘Integration Testing

Integration Testing is the phase where individual software modules are combined and tested as a group to ensure they work together correctly. The video mentions it as another initial testing level where White Box Testing is used to check the interaction between different parts of the software.

πŸ’‘Happy Scenario

The 'Happy Scenario' refers to the testing approach where the aim is to ensure the software performs its minimum requirements as expected under normal conditions. The video script explains it as 'Test to pass', where test cases are written to confirm that the software works as intended without any issues.

πŸ’‘Bad Scenario

The 'Bad Scenario' in software testing is the strategy of testing the software under extreme or unfavorable conditions to find its weaknesses and bugs. The video script describes it as 'Test to fail', where the tester intentionally chooses difficult scenarios to stress-test the software and identify potential failures.

Highlights

Black Box Testing is applied for functional and non-functional testing without referring to the internal structure of the system.

Black Box Testing is also known as 'specification based testing'.

In Black Box Testing, inputs are added to a running program without seeing the program's code.

The output is compared against the expected result written in the specification to determine if the test passes or fails.

Black Box Testing is suitable for System Testing and Acceptance Testing.

White Box Testing is referred to as 'Structural based testing' or 'glass box testing'.

White Box Testing involves seeing the internal structure of the system and having access to the source code.

This type of testing focuses on the structure of the code, ensuring all paths and conditions are covered.

White Box Testing is more suitable for initial levels of testing such as Unit Testing and Integration Testing.

Test cases in White Box Testing are designed for the logic test of the program.

Testing techniques can be used to write test cases for two reasons: to pass (Happy scenario) and to fail (Bad scenario).

The 'Test to pass' aims to assure that the software meets its minimum requirements.

The 'Test to fail' strategy involves choosing the hardest scenarios to find the weaknesses and bugs in the software.

Writing test cases that can damage the program is part of the 'Test to fail' approach.

Training, practicing, and learning are essential for effectively identifying 'test to pass' and 'test to fail' scenarios.

Both Black Box and White Box testing have their unique applications and are crucial in different stages of the software testing process.

Transcripts

play00:03

Black Box Testing

play00:05

& white Box Testing:

play00:07

what is the difference between them? when do we use them?

play00:09

which one of them will be used in

play00:11

each level of testing?

play00:13

That is what we will know together.

play00:15

we will start with Black box testing

play00:17

which we apply for functional and non-functional

play00:19

without referring to

play00:21

the internal structure of the system

play00:23

which we call "specification based testing"

play00:25

because I have

play00:27

a running program and according to

play00:29

its specification,I can try its execution

play00:31

I will add input

play00:33

without seeing the program's code.

play00:35

if the output is the same as the expected result

play00:37

written in the specification,

play00:39

then the result is "pass".

play00:41

if not, then it is "fail".

play00:43

For example, if the required is a ,

play00:45

it presents a certain value when

play00:47

we add numbers on it. so we test

play00:49

the output and if the result i have is correct or

play00:51

without referring to the calculator's code

play00:53

I should act from

play00:55

the view of the end user,

play00:57

and deal as a user

play00:59

who doesn't have any technical background.

play01:01

therefore, the Black box testing

play01:03

is suitable for all the

play01:05

last testing levels, such as

play01:07

System testing and acceptance testing.

play01:09

As for the White box testing

play01:11

which we call "Structural based testing"

play01:13

or "glass box testing".

play01:15

From its name, we can understand that

play01:17

I can see the internal of the system

play01:19

and I have at least the source code.

play01:21

it focuses on the structure

play01:23

of the code. Since the code of

play01:25

the system has paths, conditions

play01:27

and many statements, this type

play01:29

of testing ensures that

play01:31

I have passed all paths and conditions

play01:33

and check if the compiler makes

play01:35

an execution for them, or there are

play01:37

some lines of codes have not been checked

play01:39

due to a certain bug. And since the test case design

play01:41

in White box testing is written

play01:43

for the logic test of the program,

play01:45

so this way of testing is more suitable

play01:47

for the initial levels of testing

play01:49

such as: Unit Testing

play01:51

and Integration Testing.

play01:53

Finally, there is an important note in

play01:55

any testing techniques, that we can write

play01:57

the test case for 2 reasons: either

play01:59

Test to pass, and that is what we call

play02:01

the Happy scenario of the software,

play02:03

or Test to fail, and that is what we call

play02:05

the Bad scenario of the software.

play02:07

in "Test to pass" our aim is to assure

play02:09

that the software is doing its minimum

play02:11

requirements. The way we write

play02:13

the test case is simple, as the user

play02:15

may use the software in a right way

play02:17

without facing any problems.

play02:19

for the "Test to fail",

play02:21

I choose the hardest scenarios

play02:23

of the software, and use the strategy

play02:25

that finds out the weaknesses of the software

play02:27

and lets me find the bugs as much as I can.

play02:29

I write the test case with the ideas

play02:31

that I can use to damage the program.

play02:33

we have to notice that, when you

play02:35

start to write the test case,

play02:37

you may fail to write the test case

play02:39

which makes this program fails.

play02:41

or you don't know any scenarios.

play02:43

Of course, this will be easier by training, practicing

play02:45

and learning which will form a good reference

play02:47

for us to find out "test to pass"

play02:49

and "test to fail", whether we work

play02:51

as Black box testing

play02:53

or White box testing.

Rate This
β˜…
β˜…
β˜…
β˜…
β˜…

5.0 / 5 (0 votes)

Related Tags
Software TestingBlack BoxWhite BoxFunctional TestingNon-FunctionalUnit TestingIntegration TestingSystem TestingAcceptance TestingTest DesignBug Detection