Skip to content
Snippets Groups Projects
VerificAndValid.tex 35.5 KiB
Newer Older
%\documentclass[handout]{beamer} 
\documentclass[t,12pt,numbers,fleqn]{beamer}
%\documentclass[ignorenonframetext]{beamer}

\newif\ifquestions
%\questionstrue
\questionsfalse

\usepackage{pgfpages} 
\usepackage{hyperref}
\hypersetup{colorlinks=true,
    linkcolor=blue,
    citecolor=blue,
    filecolor=blue,
    urlcolor=blue,
    unicode=false}
\urlstyle{same}

\bibliographystyle{plain}

%\usetheme{Iimenau}

\useoutertheme{split} %so the footline can be seen, without needing pgfpages

%\pgfpagesuselayout{resize to}[letterpaper,border shrink=5mm,landscape]  %if this is uncommented, the hyperref links do not work

\mode<presentation>{}

\input{../def-beamer}

\newcommand{\topic}{09 Verification and Validation}

\input{../titlepage}

\begin{document}

\input{../footline}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Verification and Validation}

\bi
\item Administrative details
\item Questions?
\item 741 workflow
\item Testing from SE perspective
\item Testing from SC perspective
\item V\&V template
\item V\&V examples
\bi
\item SWHS
\item Mesh Gen
\item Rogue Reborn
\ei
\ei
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Administrative Details}

\bi
\item SRS Presentation grades on Avenue
\item GitHub issues for colleagues
\bi
\item Assigned 1 colleague (see \texttt{Repos.xlsx} in repo)
\item Provide at least 5 issues on their SRS
\item Grading
\bi
\item Not enough issues, or poor issues 0/2
\item Enough issues, but shallow 1/2
\item Enough issues and deep (not surface) 2/2
\ei
\item Due by Tuesday, Oct 10, 11:59 pm
\ei
\item Reading week next week, no 741 classes
\ei

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Administrative Details: Deadlines}
~\newline
\begin{tabular}{l l l}
\textbf{SRS} & Week 05 & Oct 4\\
\textbf{SRS Issues} & Reading week & Oct 10\\
\textbf{V\&V Present} & Week 06 & Week of Oct 16\\
\textbf{V\&V Plan} & Week 07 & Oct 25\\
MG Present & Week 08 & Week of Oct 30\\
MG & Week 09 & Nov 8\\
MIS Present & Week 10 & Week of Nov 13\\
MIS & Week 11 & Nov 22\\
Impl.\ Present & Week 12 & Week of Nov 27\\
Final Documentation & Week 13 & Dec 6\\
\end {tabular}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Administrative Details: Presentation Schedule}

\bi
\item V\&V Present
\bi
\item \textbf{Tuesday: Steven, Alexandre P., Alexander S.}
\item \textbf{Friday: Geneva, Jason, Yuzhi}
\item Tuesday: Xiaoye, Shusheng, Devi, Keshav, Alex P, Paul
\item Friday: Yuzhi, Jason, Geneva, Alex S, Isobel, Steven
\ei
\item MIS Present
\bi
\item Tuesday: Isobel, Keshav, Paul
\item Friday: Shusheng, Xiaoye, Devi
\ei
\item Impl.\ Present
\bi
\item Tuesday: Alexander S., Steven, Alexandre P.
\item Friday: Jason, Geneva, Yuzhi
\ei

\ei

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Questions?}
\begin{itemize}
\item Questions about SRS?
\end{itemize}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{``Faked'' Rational Design Process}

\begin{center}
\includegraphics[scale=0.7]{../Figures/OverviewOfProcess.pdf}
\end{center}

%See Parnas and Clements 1986 about ``Faking It''

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Outline of Verification Topics}

\begin{itemize}

\item What are the goals of verification?
\item What are the main approaches to verification?
\begin{itemize}
\item What kind of assurance do we get through testing?  
\item \structure{Can testing prove correctness?}
\item How can testing be done systematically?
\item How can we remove defects (debugging)?
\end{itemize}
\item What are the main approaches to software analysis?
\item Informal versus formal analysis

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Incorrect Version of Delete}

Using \texttt{s = new T[MAX\_SIZE]}, for some type \texttt{T}

\lstset{language=java,breaklines=true,showspaces=false,showstringspaces=false,breakatwhitespace=true}
\noindent \lstinputlisting{DeleteIncorrect.java}

\bi
\item \structure{What is the error?}
\item \structure{What test case would highlight the error?}
\ei

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Correct Version of Delete}

\lstset{language=java,breaklines=true,showspaces=false,showstringspaces=false,breakatwhitespace=true}
\noindent \lstinputlisting{DeleteCorrect.java}

Avoids potential ArrayIndexOutOfBoundsException Exception

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Verification Versus Validation}

\begin{itemize}

\item \structure{What is the difference between verification and
    validation?}

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Verification Versus Validation}

\begin{itemize}

\item Verification - Are we building the product right?  Are we implementing the
  requirements correctly (internal)
\item Validation - Are we building the right product? Are we getting the right
  requirements (external)
\item According to
  \href{https://en.wikipedia.org/wiki/Software_verification_and_validation}{Capability
    Maturity Model (CMM)}
\bi
\item 
    Software Verification: The process of evaluating software to determine
    whether the products of a given development phase satisfy the conditions
    imposed at the start of that phase. [IEEE-STD-610]
  \item Software Validation: The process of evaluating software during or at the
    end of the development process to determine whether it satisfies specified
    requirements. [IEEE-STD-610] 
\ei
\item We will focus on verification
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Verification Activities}

\begin{center}
\includegraphics[scale=0.55]{../Figures/SoftwareLifecycle.png}
\end{center}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\begin{frame}
\frametitle{Need for Verification}

\begin{itemize}

\item Designers are fallible even if they are skilled and follow sound principles
\item We need to build confidence in the software
\item Everything must be verified, every required functionality, every required
  quality, every process, every product, every document
\item For every work product covered in this class we have discussed its verification
\item Even verification itself must be verified

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Properties of Verification}

From \cite{GhezziEtAl2003}

\begin{itemize}

\item May not be binary (OK, not OK)
\begin{itemize}
\item Severity of defect is important
\item Some defects may be tolerated
\item Our goal is typically acceptable reliability, not correctness
\end{itemize}
\item May be subjective or objective - for instance, usability, generic level of
  maintainability or portability
\bi
\item \structure{How might we make usability objective?}
\ei
\item Even implicit qualities should be verified
\begin{itemize}
\item Because requirements are often incomplete
\item For instance robustness, maintainability
\end{itemize}
\item \structure{What is better than implicitly specified
    qualities?} % explicit!
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Approaches to Verification}

\begin{itemize}

\item \structure{What are some approaches to verification?}
\item \structure{How can we categorize these approaches?}

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Approaches to Verification}

\begin{itemize}

\item Experiment with behaviour of product
\begin{itemize}
\item Sample behaviours via testing
\item Goal is to find ``counter examples''
\item \structure{Dynamic} technique
\item Examples: unit testing, integration testing, acceptance testing, white box
  testing, stress testing, etc.
\end{itemize}
\item Analyze product to deduce its adequacy
\begin{itemize}
\item Analytic study of properties
\item \structure{Static} technique
\item Examples: Code walk-throughs, code inspections, correctness proof, etc.
\end{itemize}

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Does our Engineering Analogy Fail?}

\begin{itemize}

\item \structure{If a bridge can hold 512 kN, can it hold 499 kN?}
\item \structure{If our software works for the input 512, will it work for 499?}

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Verification in Engineering}

\begin{itemize}

\item Example of bridge design
\item One test assures infinite correct situations
\item In software a small change in the input may result in significantly different behaviour
\item There are also chaotic systems in nature, but products of engineering
  design are usually stable and well-behaved
% consider the examples of weather, bifurcation in engineering, chaos theory for traffic, etc.
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Modified Version Works for 512, but not 499}

\includegraphics[scale=0.5]{../Figures/BinarySearch.png}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Testing and Lack of ``Continuity''}

\begin{itemize}

\item Testing samples behaviours by examining ``test cases''
\item Impossible to extrapolate behaviour of software from a finite set of test cases
\item No continuity of behaviour - it can exhibit correct behaviour in
  infinitely many cases, but may still be incorrect in some cases

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Goals of Testing}

\begin{itemize}

\item \structure{If our code passes all test cases, is it now guaranteed to be
    error free?}
\item \structure{Are 5000 random tests always better than 5 carefully selected
    tests?}

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Goals of Testing}

\begin{itemize}

\item To show the \structure{presence} of bugs (Dijkstra, 1972)
\item If tests do not detect failures, we cannot conclude that software is defect-free
\item Still, we need to do testing - driven by sound and systematic principles
\begin{itemize}
\item Random testing is often not a systematic principle to use
% look at the example from the text, or divide by zero within a circular range
\item Need a test plan
\end{itemize}
\item Should help isolate errors - to facilitate debugging

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Goals of Testing Continued}

\begin{itemize}
\item Should be repeatable
\begin{itemize}
\item Repeating the same experiment, we should get the same results
\item Repeatability may not be true because of the effect of the execution
  environment on testing
\item Repeatability may not occur if there are uninitialized variables
\item Repeatability may not happen when there is nondeterminism
\end{itemize}

\item Should be accurate
\begin{itemize}
\item Accuracy increases reliability
\item Part of the motivation for formal specification
\end{itemize}

\item \structure{Is a \structure{successful} test case one that passes the test, or one
  that shows a failure?}

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Test (V\&V) Plan}

\begin{itemize}

\item \structure{Given that no single verification technique can prove
    correctness, the practical approach is to use ALL verification techniques.
    Is this statement True or False?}

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Test (V\&V) Plan}

\begin{itemize}

\item Testing can uncover errors and build confidence in the software
\item Resources of time, people, facilities are limited
\item Need to plan how the software will be tested
\item You know in advance that the software is unlikely to be perfect
\item You need to put resources into the most important parts of the project
\item A risk analysis can determine where to put your limited resources
\item A risk is a condition that can result in a loss
\item Risk analysis involves looking at how bad the loss can be and at the
  probability of the loss occurring

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{White Box Versus Black Box Testing}
\begin{itemize}
\item \structure{Do you know (or can you guess) the difference between white box
    and black box testing?}
\item \structure{What if they were labelled transparent box and opaque box
    testing, respectively?}
\end{itemize}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{White Box Versus Black Box Testing}
\begin{itemize}
\item White box testing is derived from the program's internal structure
\item Black box testing is derived from a description of the program's function
\item Should perform both white box and black box testing
\item Black box testing
\begin{itemize}
\item Uncovers errors that occur in implementing requirements or design specifications
\item Not concerned with how processing occurs, but with the results
\item Focuses on functional requirements for the system
\item Focuses on normal behaviour of the system
\end{itemize}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{White Box Testing}

\begin{itemize}
\item Uncovers errors that occur during implementation of the program
\item Concerned with how processing occurs
\item Evaluates whether the structure is sound
%\item Focuses on the nonfunctional requirements for the system
\item Focuses on abnormal or extreme behaviour of the system
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322
\begin{frame}
\frametitle{Dynamic Testing}
\begin{itemize}
\item \structure{Is there a dynamic testing technique that can guarantee
    correctness?}
\item \structure{If so, what is the technique?}
\item \structure{Is this technique practical?}
\end{itemize}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Dynamic Versus Static Testing}
\begin{itemize}
\item Another classification of verification techniques, as previously discussed
\item Use a combination of dynamic and static testing
\item Dynamic analysis
\begin{itemize}
\item Requires the program to be executed
\item Test cases are run and results are checked against expected behaviour
\item Exhaustive testing is the only dynamic technique that guarantees program
validity
\item Exhaustive testing is usually impractical or impossible
\item Reduce number of test cases by finding criteria for choosing representative test cases
\end{itemize}
\end{itemize}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Static Testing Continued}
\begin{itemize}
\item Static analysis
\begin{itemize}
\item Does not involve program execution
\item Testing techniques simulate the dynamic environment
\item Includes syntax checking
\item Generally static testing is used in the requirements and design stage, where there is no code to execute
\item Document and code walkthroughs
\item Document and code inspections
\end{itemize}
\end{itemize}
\end{frame}
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Manual Versus Automated Testing}
\begin{itemize}
\item \structure{What is the difference between manual and automated testing?}
\item \structure{What are the advantages of automated testing?}
\item \structure{What is regression testing?}
\end{itemize}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Manual Versus Automated Testing}
\begin{itemize}
\item Manual testing
\begin{itemize}
\item Has to be conducted by people
\item Includes by-hand test cases, structured walkthroughs, code inspections
\end{itemize}
\item Automated testing
\begin{itemize}
\item The more automated the development process, the easier to automate testing
\item Less reliance on people
\item Necessary for \structure{regression testing}
\item Test tools can assist, such as Junit, Cppunit, CuTest etc.
\item Can be challenging to automate GUI tests
\item Test suite for Maple has 2 000 000 test cases, run on 14 platforms, every
  night, automated reporting
\end{itemize}
\end{itemize}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% \begin{frame}
% \frametitle{Automated Testing at MapleSoft}
% \begin{itemize}
% \item Three steps
% \begin{itemize}
% \item Write the problem description
% \item result := solver(problem)
% \item assert(result == expected)
% \end{itemize}
% \item Assert writes out code to reproduce any failures
% \item Track failures
% \begin{itemize}
% \item Source code management (like CVS or Subversion)
% \item Database of test cases, functions called
% \item Database of source files, functions defined
% \item Database of 40 days of timings and resources used
% \end{itemize}
% \item Automatically sends an e-mail to the programmer and his/her boss
% \end{itemize}
% \end{frame}

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Continuous Integration Testing}
\begin{itemize}
\item \structure{What is continuous integration testing?}
\end{itemize}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Continuous Integration Testing}
\begin{itemize}
\item Information available on
  \href{https://en.wikipedia.org/wiki/Continuous_integration}{Wikipedia}
\item Developers integrate their code into a shared repo frequently (multiple
  times a day)
\item Each integration is automatically accompanied by regression tests and
  other build tasks
\item Build server
\bi
\item Unit tests
\item Integration tests
\item Static analysis
\item Profile performance
\item Extract documentation
\item Update project web-page
\item Portability tests
\item etc.
\ei
\item Avoids potentially extreme problems with integration when the baseline and
  a developer's code greatly differ
\end{itemize}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Continuous Integration Tools}
\begin{itemize}
\item Gitlab
\bi
\item Example at
  \href{https://gitlab.cas.mcmaster.ca/andrem5/RogueReborn/pipelines}{Rogue
    Reborn}
\ei
\item Jenkins
\item Travis
\item \href{https://www.docker.com/}{Docker}
\bi
\item Eliminates the ``it works on my machine'' problem
\item Package dependencies with your apps
\item A container for lightweight virtualization
\item Not a full VM
\ei
\end{itemize}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Sample Nonfunctional System Testing}
\begin{itemize}
\item Stress testing - Determines if the system can function when subject to large volumes
\item Usability testing
\item Performance measurement
\end{itemize}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Functional System Testing}
\begin{itemize}
\item Requirements: Determines if the system can perform its function correctly and that the correctness can be
sustained over a continuous period of time
%\item Regression: Determines if changes to the system do not invalidate previous positive testing results
\item Error Handling: Determines the ability of the system to properly process incorrect transactions
\item Manual Support: Determines that the manual support procedures are documented and complete, where manual support
involves procedures, interfaces between people and the system, and training procedures
\item Inter-systems: Determines the that interconnections between systems function correctly
\end{itemize}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Sample Functional System Testing}
\begin{itemize}
\item Requirements: Determines if the system can perform its function correctly and that the correctness can be
sustained over a continuous period of time
%\item Regression: Determines if changes to the system do not invalidate previous positive testing results
\item Error Handling: Determines the ability of the system to properly process
  incorrect transactions
\item Manual Support: Determines that the manual support procedures are documented and complete, where manual support
involves procedures, interfaces between people and the system, and training procedures
\item Parallel: Determines the results of the new application are consistent with the processing of the previous
application or version of the application
\end{itemize}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Testing Phases}
\begin{enumerate}
\item Unit testing
\item Integration testing
\item System testing
\item Acceptance testing
\end{enumerate}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Theoretical Foundations Of Testing: Definitions}
\begin{itemize}
\item P (program), D (input domain), R (output domain)
\bi
\item P: D $\rightarrow$ R (may be partial)
\ei
\item Correctness defined by OR $\subseteq$ D $\times$ R
\bi
\item P(d) correct if $\langle$ d, P(d) $\rangle \in$ OR
\item P correct if all P(d) are correct
\ei
\item Failure
\bi
\item P(d) is not correct
\item May be undefined (error state) or may be the wrong result
\ei
\item Error (Defect)
\bi
\item Anything that may cause a failure
\bi
\item Typing mistake
\item Programmer forgot to test ``x=0''
\ei
\ei
\item Fault
\bi
\item Incorrect intermediate state entered by program
\ei
\end{itemize}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Definitions Questions}
\begin{itemize}
\item \structure{A test case t is an element of D or R?}
\item \structure{A test set T is a finite subset of D or R?}
\item \structure{How would we define whether a test is successful?}
\item \structure{How would we define whether a test set is successful?}
\end{itemize}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Definitions Continued}
\begin{itemize}
\item Test case t: An element of D
\item Test set T: A finite subset of D
\item Test is successful if P(t) is correct
\item Test set successful if P correct for all t in T
\end{itemize}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Theoretical Foundations of Testing}

\begin{itemize}
\item Desire a test set $T$ that is a finite subset of $D$ that will uncover all errors
\item Determining and ideal $T$ leads to several
  \href{https://en.wikipedia.org/wiki/Undecidable_problem}{undecideable
    problems}
\item No algorithm exists:
\bi
\item To state if a test set will uncover all possible errors
\item To derive a test set that would prove program correctness
\item To determine whether suitable input exists to guarantee execution of a
  given statement in a given program
\item etc.
\ei
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Empirical Testing}

\begin{itemize}
\item Need to introduce empirical testing principles and heuristics as a
  compromise between the impossible and the inadequate
\item Find a strategy to select \structure{significant} test cases
\item Significant means the test cases have a high potential of uncovering the
  presence of errors
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Complete-Coverage Principle}

\begin{itemize}
\item Try to group elements of $D$ into subdomains $D_1$, $D_2$, ..., $D_n$
  where any element of each $D_i$ is likely to have similar behaviour
\item $D = D_1 \cup D_2 \cup ... \cup D_n$
\item Select one test as a representative of the subdomain
\item If $D_j \cap D_k = \emptyset$ for all $j \neq k$, (partition), any element
  can be chosen from each subdomain
\item Otherwise choose representatives to minimize number of tests, yet
  fulfilling the principle
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Complete-Coverage Principle}

\includegraphics[scale=0.5]{../Figures/CompleteCoveragePrinciple.png}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{White-box Testing}

\begin{itemize}
\item \structure{Intuitively, after running your test suites, what percentage of
    the lines of code in your program should be exercised?}
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{White-box Coverage Testing}

\begin{itemize}
\item (In)adequacy criteria - if significant parts of the program structure are not tested, testing is inadequate
\item Control flow coverage criteria
\begin{itemize}
\item Statement coverage
\item Edge coverage
\item Condition coverage
\item Path coverage
\end{itemize}
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Statement-Coverage Criterion}

\begin{itemize}
\item Select a test set $T$ such that every elementary statement in $P$ is
  executed at least once by some $d$ in $T$
\item An input datum executes many statements - try to minimize the number of
  test cases still preserving the desired coverage
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Example}

\includegraphics[scale=0.5]{../Figures/ExampleStatementCoverageOnlyCode.png}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Example}

\includegraphics[scale=0.5]{../Figures/ExampleStatementCoverage.png}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Weakness of the Criterion}

\includegraphics[scale=0.6]{../Figures/WeaknessStatementCoverageOnlyCode.png}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Weakness of the Criterion}

\includegraphics[scale=0.6]{../Figures/WeaknessStatementCoverage.png}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Edge-Coverage Criterion}

\begin{itemize}
\item Select a test set $T$ such that every edge (branch) of the control flow is
  exercised at least once by some $d$ in $T$
\item This requires formalizing the concept of the control graph and how to construct it
\begin{itemize}
\item Edges represent statements
\item Nodes at the ends of an edge represent entry into the statement and exit
\end{itemize}
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Control Graph Construction Rules}

\includegraphics[scale=0.4]{../Figures/ControlGraphRules.png}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Simplification}

A sequence of edges can be collapsed into just one edge\\
~\newline

\includegraphics[scale=0.5]{../Figures/Simplification.png}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Example: Euclid's Algorithm}

\includegraphics[scale=0.5]{../Figures/EuclidsAlgorithmNoGraph.png}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Example: Euclid's Algorithm}

\includegraphics[scale=0.5]{../Figures/EuclidsAlgorithm.png}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Weakness}

\includegraphics[scale=0.4]{../Figures/WeaknessEdgeCoverage.png}\\
\uncover<2->{\structure{Do not discover the error ($<$ instead of $\leq$)}}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
%\frametitle{Alternative View of Condition Coverage}

\lstset{language=java,breaklines=true,showspaces=false,showstringspaces=false,breakatwhitespace=true}
\noindent \lstinputlisting{CondCovExample.java}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Condition-Coverage Criterion}

\begin{itemize}
\item Select a test set $T$ such that every edge of $P$'s control flow is traversed and all possible values of the
constituents of compound conditions are exercised at least once
\item This criterion is finer than edge coverage
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Weakness}

\includegraphics[scale=0.5]{../Figures/WeaknessConditionCoverage.png}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Path-Coverage Criterion}

\begin{itemize}
\item Select a test set $T$ that traverses all paths from the initial to the final node of $P$s control flow
\item It is finer than the previous kinds of coverage
\item However, number of paths may be too large, or even infinite (see while loops)
\item Loops
\begin{itemize}
\item Zero times (or minimum number of times)
\item Maximum times
\item Average number of times
\end{itemize}
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{The Infeasibility Problem}

\begin{itemize}
\item Syntactically indicated behaviours (statements, edges, etc.) are often impossible
\item Unreachable code, infeasible edges, paths, etc.
\item Adequacy criteria may be impossible to satisfy
\begin{itemize}
\item Manual justification for omitting each impossible test case
\item Adequacy ``scores'' based on coverage - example 95 \% statement coverage
\end{itemize}
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Further Problem}

\begin{itemize}
\item What if the code omits the implementation of some part of the specification?
\item White box test cases derived from the code will ignore that part of the specification!
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Testing Boundary Conditions}

\begin{itemize}

\item Testing criteria partition input domain in classes, assuming that behavior
  is ``similar'' for all data within a class
\item Some typical programming errors, however, just happen to be at the
  boundary between different classes
\begin{itemize}
\item Off by one errors
\item $<$ instead of $\leq$
\item equals zero
\end{itemize}
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Criterion}

\begin{itemize}

\item After partitioning the input domain D into several classes, test the
  program using input values not only ``inside'' the classes, but also at their
  boundaries
\item This applies to both white-box and black-box techniques
\item In practice, use the different testing criteria in combinations
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{The Oracle Problem}

\structure{When might it be difficult to know the ``expected''
  output/behaviour?}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{The Oracle Problem}

\begin{itemize}

\item Given input test cases that cover the domain, what are the expected
  outputs?
\item Oracles are required at each stage of testing to tell us what the right
  answer is
\item Black-box criteria are better than white-box for building test oracles
\item Automated test oracles are required for running large amounts of tests
\item Oracles are difficult to design - no universal recipe
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{The Oracle Problem Continued}

\begin{itemize}

\item Determining what the right answer should be is not always easy
\begin{itemize}
%\item Air traffic control system
\item Scientific computing
\item Machine learning
\item Artifical intelligence
\end{itemize}
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{The Oracle Problem Continued}

\structure{What are some strategies we can use when we do not have a test
  oracle?}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Strategies Without An Oracle}

\begin{itemize}

\item Using an independent program to approximate the oracle (pseudo oracle)
\item Method of manufactured solutions
\item Properties of the expected values can be easier than stating the expected
  output
\bi
\item \uncover<1>{\structure<1>{Examples?}}
\item \uncover<2->{List is sorted}
\item \uncover<2->{Number of entries in file matches number of inputs}
\item \uncover<2->{Conservation of energy or mass}
\item \uncover<2->{Expected trends in output are observed (metamorphic testing)}
\item \uncover<2->{etc.}
\ei
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Mutation Testing for SC}
\begin{itemize}
\item Generate changes to the source code, called mutants, which become code faults
\item Mutants include changing an operation, modifying constants, changing the order of execution, etc.
\item The adequacy of a set of tests is established by running the tests on all generated mutants
\item Need to account for floating point approximations
\item See Hook and Kelly, 2009
\end{itemize}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Analysis of Units}
\begin{itemize}
\item Dynamic testing of units is not the only option
\item Static testing (analysis) includes the following
\begin{itemize}
\item Informal inspection
\item Systematic inspection
\item Code walkthroughs, data flow analysis
\item Correctness proofs (for instance using pre and post conditions)
\item Complexity measures
\end{itemize}
\end{itemize}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Challenges Specific to Scientific Computing}
\begin{itemize}
\item Unknown solution
\item Approximation of real numbers
\item Nonfunctional requirements
\item Parallel computation
\end{itemize}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Validation Testing Report for PMGT}
\begin{itemize}
\item Prepared by Wen Yu
\item Do not know the correct solution, but know properties of the correct solution
\item Automated correctness validation tests
\begin{itemize}
\item The area of each element is greater than zero
\item The boundary of the mesh is closed
\item Vertices in a clockwise order
\item $nc + nv - ne = 1$
\item ...
\end{itemize}
\item Visual correctness validation tests
\begin{itemize}
\item No vertex outside the input domain
\item No vertex inside a cell
\item No dangling edges
\item All cells connected
\item  The mesh is conformal
\end{itemize}
\end{itemize}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Validation Testing Report for PMGT (Continued)}
\begin{itemize}
\item List and description of test cases
\item Test cases are labelled and numbered
\item Traceability to SRS requirements
\item Traceability to MG
\item Summary of results
\item Analysis of results
\begin{itemize}
\item Focus on nonfunctional requirements
\item Speed
\end{itemize}
\end{itemize}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}[allowframebreaks]
\frametitle{References}

\bibliography{../../ReferenceMaterial/References}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\end{document}