testing-debugging/questions.rst
changeset 487 cb3974daced5
parent 401 abf092be95ef
equal deleted inserted replaced
486:591369704df0 487:cb3974daced5
     1 Objective Questions
     1 Objective Questions
     2 -------------------
     2 -------------------
     3 
     3 
     4 .. A mininum of 8 questions here (along with answers)
     4 .. A mininum of 8 questions here (along with answers)
     5 
     5 
     6 1. Question 1
     6 1. Why do we do Software Testing?
       
     7    
       
     8    Answer: To evaluate a program and determine that it meets required results.
     7 
     9 
     8    Answer: Answer 1
    10               
       
    11 
       
    12 
       
    13 2. What is proper indentation for python code according to style guidelines?
       
    14 
       
    15    Answer: Four Space Indentation
     9    
    16    
    10    OR
    17 3. What is the idiom used for running python scripts in a standalone manner?
    11    
    18    
    12    Answer::
    19    Answer: 
       
    20    if __name__ == '__main__':
       
    21      
       
    22 4. What constitutes a test case?
       
    23 
       
    24    Answer: A set of inputs and expected result
       
    25 
       
    26 5. How do you start the debugger on ipython?
       
    27 
       
    28    Answer: %debug
       
    29 
       
    30 6. What idiom do you use for catching and exception?
       
    31 
       
    32    Answer: try,catch.
       
    33 
       
    34 7. What kind of exception is 0/0?
       
    35 
       
    36    Answer Zero Division Error
       
    37 
       
    38 8. a = 12.68
       
    39    b = 0.05
       
    40    c = round(a/b)
       
    41    d = c * b
       
    42 
       
    43    What would you recommend to the programmer who wrote
       
    44    above written piece of code.
       
    45 
    13    
    46    
    14      answer code line 1
       
    15      answer code line 2
       
    16      answer code line 3
       
    17 
    47 
    18 2. Question 2
    48 
    19 3. Question 3
       
    20 
    49 
    21 
    50 
    22 Larger Questions
    51 Larger Questions
    23 ----------------
    52 ----------------
    24 
    53 
    25 .. A minimum of 2 questions here (along with answers)
    54 .. A minimum of 2 questions here (along with answers)
    26 
    55 
    27 1. Question 1
    56 1. Write a program for checking if two numbers are coprime
    28 2. Question 2
    57    Create test cases for it and automate it.
       
    58 2. Write a program that divides two numbers. Take the numbers from the user. Also make sure the code tell the user that input is invalid incase the divisor is 0.
       
    59 
       
    60