Podcast
Questions and Answers
Based on the Python code for the function "calc_bmi()" below, which of the following PyTest assertions would Pass ?
def calc_bmi (bmi):
if bmi < 18.5:
return 0
elif bmi >= 18.5 and bmi < 30:
return 1
else:
return 2
Based on the Python code for the function "calc_bmi()" below, which of the following PyTest assertions would Pass ?
def calc_bmi (bmi): if bmi < 18.5: return 0 elif bmi >= 18.5 and bmi < 30: return 1 else: return 2
- assert (calc_bmi(30) == 1) (correct)
- assert (calc_bmi(18.5) == 1)
- assert (calc_bmi(18.5) == 0)
- assert (calc_bmi(30.5) == 2)
Which of the following can Software Unit Tests be classified as ?
Which of the following can Software Unit Tests be classified as ?
- Black Box Tests
- System Tests
- Grey Box Tests
- White Box Tests (correct)
Which of the following are possible benefits to developing Software Unit Test cases ?
Which of the following are possible benefits to developing Software Unit Test cases ?
- It will improve the documentation of the code base
- Unit Tests help to simplify the code
- It helps to make the code more efficient and execute faster
- Software Unit Test cases can be reused and executed again to validate of the code still functions correctly (correct)
In the PyTest framework, which constructs or functions are usually used to evaluate test conditions ?
In the PyTest framework, which constructs or functions are usually used to evaluate test conditions ?
Which of the following scenarios best describes a System Test for a "Drinks Vending Machine" project?
Which of the following scenarios best describes a System Test for a "Drinks Vending Machine" project?
In Python. which of the following is a commonly used Unit Testing framework?
In Python. which of the following is a commonly used Unit Testing framework?
Which of the following statements is correct?
Which of the following statements is correct?
Which of the following is not a Software Unit Test tool?
Which of the following is not a Software Unit Test tool?
Flashcards
Software Unit Tests
Software Unit Tests
Tests focused on small, isolated parts (units) of software code.
White Box Tests
White Box Tests
Software tests that examine the internal structure and workings of a system.
PyTest assertions
PyTest assertions
Functions in PyTest used to check if conditions are true during testing.
System Test (Drinks Vending Machine)
System Test (Drinks Vending Machine)
Signup and view all the flashcards
Python Unit Testing Framework
Python Unit Testing Framework
Signup and view all the flashcards
System Unit Test Success vs. System Test Success
System Unit Test Success vs. System Test Success
Signup and view all the flashcards
calc_bmi Return Value (30)
calc_bmi Return Value (30)
Signup and view all the flashcards
Unit Test Tool (not PIP)
Unit Test Tool (not PIP)
Signup and view all the flashcards