🎧 New: AI-Generated Podcasts Turn your study notes into engaging audio conversations. Learn more

DOAIOT chap 5
8 Questions
2 Views

DOAIOT chap 5

Created by
@CleanJasmine

Podcast Beta

Play an AI-generated podcast conversation about this lesson

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

  • 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 ?

  • 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 ?

  • 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 ?

    <p>assert</p> Signup and view all the answers

    Which of the following scenarios best describes a System Test for a "Drinks Vending Machine" project?

    <p>Deposit $1.2 of coins and check that the LCD display correctly shows $1.20 after the coins have been deposited</p> Signup and view all the answers

    In Python. which of the following is a commonly used Unit Testing framework?

    <p>PyTest</p> Signup and view all the answers

    Which of the following statements is correct?

    <p>If all System Unit Test cases pass, it's not guaranteed that all System Test cases will pass</p> Signup and view all the answers

    Which of the following is not a Software Unit Test tool?

    <p>PIP</p> Signup and view all the answers

    More Quizzes Like This

    Use Quizgecko on...
    Browser
    Browser