testing-debugging/slides.org
author Amit Sethi
Fri, 12 Nov 2010 02:01:28 +0530
changeset 487 cb3974daced5
parent 403 9858ca9e3f93
permissions -rw-r--r--
Added questions and slides for testing and debugging
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
401
abf092be95ef Adding testing and debugging files
Amit Sethi
parents:
diff changeset
     1
#+LaTeX_CLASS: beamer
abf092be95ef Adding testing and debugging files
Amit Sethi
parents:
diff changeset
     2
#+LaTeX_CLASS_OPTIONS: [presentation]
abf092be95ef Adding testing and debugging files
Amit Sethi
parents:
diff changeset
     3
#+BEAMER_FRAME_LEVEL: 1
abf092be95ef Adding testing and debugging files
Amit Sethi
parents:
diff changeset
     4
abf092be95ef Adding testing and debugging files
Amit Sethi
parents:
diff changeset
     5
#+BEAMER_HEADER_EXTRA: \usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent}
abf092be95ef Adding testing and debugging files
Amit Sethi
parents:
diff changeset
     6
#+COLUMNS: %45ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) %4BEAMER_col(Col) %8BEAMER_extra(Extra)
abf092be95ef Adding testing and debugging files
Amit Sethi
parents:
diff changeset
     7
#+PROPERTY: BEAMER_col_ALL 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 :ETC
abf092be95ef Adding testing and debugging files
Amit Sethi
parents:
diff changeset
     8
abf092be95ef Adding testing and debugging files
Amit Sethi
parents:
diff changeset
     9
#+LaTeX_CLASS: beamer
abf092be95ef Adding testing and debugging files
Amit Sethi
parents:
diff changeset
    10
#+LaTeX_CLASS_OPTIONS: [presentation]
abf092be95ef Adding testing and debugging files
Amit Sethi
parents:
diff changeset
    11
abf092be95ef Adding testing and debugging files
Amit Sethi
parents:
diff changeset
    12
#+LaTeX_HEADER: \usepackage[english]{babel} \usepackage{ae,aecompl}
abf092be95ef Adding testing and debugging files
Amit Sethi
parents:
diff changeset
    13
#+LaTeX_HEADER: \usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet}
abf092be95ef Adding testing and debugging files
Amit Sethi
parents:
diff changeset
    14
abf092be95ef Adding testing and debugging files
Amit Sethi
parents:
diff changeset
    15
#+LaTeX_HEADER: \usepackage{listings}
abf092be95ef Adding testing and debugging files
Amit Sethi
parents:
diff changeset
    16
abf092be95ef Adding testing and debugging files
Amit Sethi
parents:
diff changeset
    17
#+LaTeX_HEADER:\lstset{language=Python, basicstyle=\ttfamily\bfseries,
403
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    18
#+LaTeX_HEADER:  commentstyle=\color{red}\itshape, stringstyle=\color{red},
401
abf092be95ef Adding testing and debugging files
Amit Sethi
parents:
diff changeset
    19
#+LaTeX_HEADER:  showstringspaces=false, keywordstyle=\color{blue}\bfseries}
abf092be95ef Adding testing and debugging files
Amit Sethi
parents:
diff changeset
    20
403
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    21
#+TITLE:     Testing and debugging
401
abf092be95ef Adding testing and debugging files
Amit Sethi
parents:
diff changeset
    22
#+AUTHOR:    FOSSEE
abf092be95ef Adding testing and debugging files
Amit Sethi
parents:
diff changeset
    23
#+EMAIL:     
abf092be95ef Adding testing and debugging files
Amit Sethi
parents:
diff changeset
    24
#+DATE:    
abf092be95ef Adding testing and debugging files
Amit Sethi
parents:
diff changeset
    25
abf092be95ef Adding testing and debugging files
Amit Sethi
parents:
diff changeset
    26
#+DESCRIPTION: 
abf092be95ef Adding testing and debugging files
Amit Sethi
parents:
diff changeset
    27
#+KEYWORDS: 
abf092be95ef Adding testing and debugging files
Amit Sethi
parents:
diff changeset
    28
#+LANGUAGE:  en
abf092be95ef Adding testing and debugging files
Amit Sethi
parents:
diff changeset
    29
#+OPTIONS:   H:3 num:nil toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
abf092be95ef Adding testing and debugging files
Amit Sethi
parents:
diff changeset
    30
#+OPTIONS:   TeX:t LaTeX:nil skip:nil d:nil todo:nil pri:nil tags:not-in-toc
abf092be95ef Adding testing and debugging files
Amit Sethi
parents:
diff changeset
    31
403
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    32
* Outline 
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    33
  - What software Testing is? 
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    34
  - Learn to test simple functions for their functionality.
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    35
  - Learn how to automate tests. 
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    36
  -  Need for coding style and some of the standards followed by the Python Community.
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    37
  -  Handling Errors and Exceptions.
401
abf092be95ef Adding testing and debugging files
Amit Sethi
parents:
diff changeset
    38
403
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    39
* gcd function
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    40
  - Create gcd.py file with:
487
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
    41
#+begin_src python
403
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    42
  def gcd(a, b):
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    43
        if a % b == 0: 
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    44
            return b
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    45
        return gcd(b, a%b)
487
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
    46
#+end_src python
403
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    47
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    48
* Test for gcd.py
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    49
  - Edit gcd.py file
487
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
    50
#+begin_src python 
403
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    51
  def gcd(a, b):
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    52
      if b == 0:
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    53
          return a
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    54
      return gcd(b, a%b)
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    55
  
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    56
  if __name__=='__main__':
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    57
      result = gcd(48, 64)
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    58
      if result != 16:
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    59
          print "Test failed"
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    60
      print "Test Passed"
487
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
    61
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
    62
#+end_src
403
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    63
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    64
* Automating tests
487
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
    65
#+begin_src python
403
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    66
    if __name=__='__main__':
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    67
    for line in open('numbers.txt'):
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    68
        numbers = line.split()
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    69
        x = int(numbers[0])
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    70
        y = int(numbers[1])
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    71
        result = int(numbers[2])
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    72
        if gcd(x, y) != result:
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    73
            print "Failed gcd test
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
    74
                          for", x, y
487
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
    75
#+end_src
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
    76
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
    77
* Question 1
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
    78
  For the same inputs as gcd write automated tests for LCM.
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
    79
* Solution 1
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
    80
#+begin_src python
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
    81
  def gcd(a, b):
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
    82
        if a % b == 0: 
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
    83
            return b
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
    84
        return gcd(b, a%b)
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
    85
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
    86
   def lcm(a, b):
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
    87
        return (a * b) / gcd(a, b)
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
    88
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
    89
    if __name__ == '__main__':
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
    90
      for line in open('lcmtestcases.txt'):
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
    91
        numbers = line.split()
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
    92
        x = int(numbers[0])
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
    93
        y = int(numbers[1])
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
    94
        result = int(numbers[2])
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
    95
       	if lcm(x, y) != result:
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
    96
            print "Failed lcm test for", x, y
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
    97
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
    98
#+end_src
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
    99
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   100
* Meaning full names
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   101
#+begin_src python   
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   102
   
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   103
   amount = 12.68
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   104
   denom = 0.05
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   105
   nCoins = round(amount / denom)
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   106
   rAmount = nCoins * denom
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   107
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   108
#+end_src
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   109
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   110
* Code style
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   111
 - Four Space Indentation
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   112
 - 79 character limit on a line
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   113
 - Funtions should be seperated by 
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   114
   blank line
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   115
 - Use Docstring
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   116
 - White space around operators 
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   117
   - l = 32 % 4
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   118
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   119
* Question 2
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   120
   - Give meaningful names to the variables in following
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   121
     code
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   122
	
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   123
     - c = a / b
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   124
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   125
* Solution 2
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   126
#+begin_src python
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   127
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   128
  quotient = dividend / divisor
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   129
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   130
#+end_src
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   131
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   132
* Code Snippet
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   133
#+begin_src python
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   134
   
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   135
  while True print 'Hello world'
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   136
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   137
#+end_src
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   138
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   139
* Error
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   140
#+begin_latex
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   141
\begin{lstlisting}
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   142
 while True print 'Hello world'
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   143
 \end{lstlisting}
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   144
  \begin{lstlisting}
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   145
  File "<stdin>", line 1, in ?
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   146
    while True print 'Hello world'
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   147
SyntaxError: invalid syntax
403
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
   148
\end{lstlisting}
487
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   149
#+end_latex
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   150
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   151
* Code Snippet
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   152
#+begin_src python
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   153
  a = raw_input("Enter a number")
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   154
  try:
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   155
	num = int(a)
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   156
   except:
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   157
	print "Wrong input ..."
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   158
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   159
#+end_src
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   160
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   161
* Using idb
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   162
#+begin_latex
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   163
\small
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   164
\begin{lstlisting}
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   165
In []: import mymodule
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   166
In []: mymodule.test()
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   167
---------------------------------------------
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   168
NameError   Traceback (most recent call last)
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   169
<ipython console> in <module>()
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   170
mymodule.py in test()
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   171
      1 def test():
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   172
      2     total=1+1
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   173
----> 3     print spam
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   174
NameError: global name 'spam' is not defined
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   175
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   176
In []: %debug
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   177
> mymodule.py(2)test()
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   178
      0     print spam
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   179
ipdb> total
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   180
2
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   181
\end{lstlisting}
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   182
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   183
#+end_latex
403
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
   184
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
   185
9858ca9e3f93 Adding testing and debugging slides
Amit Sethi
parents: 401
diff changeset
   186
487
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   187
* Summary
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   188
 - Create simple tests for a function.
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   189
 - Learn to Automate tests using many predefined test cases.
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   190
 - Good coding standards.
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   191
 - Difference between syntax error and exception.
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   192
 - Handling exception using try and except.
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   193
 - Using %debug for debugging on ipython.
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   194
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   195
* Thank you!
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   196
#+begin_latex
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   197
  \begin{block}{}
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   198
  \begin{center}
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   199
  This spoken tutorial has been produced by the
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   200
  \textcolor{blue}{FOSSEE} team, which is funded by the 
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   201
  \end{center}
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   202
  \begin{center}
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   203
    \textcolor{blue}{National Mission on Education through \\
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   204
      Information \& Communication Technology \\ 
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   205
      MHRD, Govt. of India}.
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   206
  \end{center}  
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   207
  \end{block}
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   208
#+end_latex
cb3974daced5 Added questions and slides for testing and debugging
Amit Sethi
parents: 403
diff changeset
   209