tag:blogger.com,1999:blog-23508033506093910932024-03-19T02:57:17.737-07:00Software Testing - Theory n PracticeSapnahttp://www.blogger.com/profile/12978592679568478683noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-2350803350609391093.post-59675022825586478172016-06-23T22:08:00.000-07:002016-06-23T22:11:43.761-07:00Software Testing Lab : Session III<div dir="ltr" style="text-align: left;" trbidi="on">
<h3 style="background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px; line-height: 1.4; text-align: justify;">
A. Triangle Problem</h3>
<div class="post-body entry-content" id="post-body-4806543135285518614" itemprop="description articleBody" style="background-color: white; position: relative; width: 570px;">
<div dir="ltr" trbidi="on">
<div style="text-align: justify;">
<div style="color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px; line-height: 1.4;">
<br /></div>
<div style="color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px; line-height: 1.4;">
The second assignment that can be given is the 'Triangle Problem'.</div>
<div style="color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px; line-height: 1.4;">
<br /></div>
<div style="color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px; line-height: 1.4;">
The program reads three numbers as input. The numbers represent the lengths of the three sides of a
triangle. The program determines whether the triangle is scalene
(three unequal sides), isosceles (two equal sides), or equilateral (three equal
sides).
The program displays the result. </div>
<div style="color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px; line-height: 1.4;">
<br /></div>
<div style="color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px; line-height: 1.4;">
An extensive analysis is given in <a href="http://www.testingeducation.org/conference/wtst3_collard5.pdf">Analyzing the Triangle Problem</a></div>
<div style="color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px; line-height: 1.4;">
<br /></div>
<h3 style="color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px; line-height: 1.4;">
<br />B. Login Problem</h3>
<div style="color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px; line-height: 1.4;">
<br /></div>
<div style="color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px; line-height: 1.4;">
Another simple assignment that will help students appreciate testing is the 'Login Problem'. </div>
<div style="color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px; line-height: 1.4;">
<br /></div>
<div style="color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px; line-height: 1.4;">
The program gets userid and passwd from the user as text. Two options exist - Cancel and Login. </div>
<div style="color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px; line-height: 1.4;">
A list of possible test cases for the problem is given in <a href="http://artoftesting.com/manualTesting/login.html">Login Problem</a></div>
<div style="color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px; line-height: 1.4;">
<br /></div>
<div>
<br />
Time taken for each session depends on the strength and weakness of the class. So, it has to be decided by the instructor.<br />
<br />
<i style="color: #660000; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13.2px; line-height: 18.48px;">Addendum : Please leave a comment. Suggestions, comments, discussions and queries are most welcome. </i></div>
</div>
</div>
</div>
</div>
Sapnahttp://www.blogger.com/profile/12978592679568478683noreply@blogger.com0tag:blogger.com,1999:blog-2350803350609391093.post-48065431352855186142016-06-23T00:21:00.000-07:002016-06-23T22:11:09.163-07:00Software Testing Lab : Session II <div dir="ltr" style="text-align: left;" trbidi="on">
<h3 class="post-title entry-title" itemprop="name" style="background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 22px; font-stretch: normal; font-weight: normal; margin: 0.75em 0px 0px; position: relative;">
</h3>
<span style="text-align: justify;">Here, we shall look at JUnit first. </span><br />
<span style="text-align: justify;"><br /></span>
<span style="text-align: justify;">1. Introduce Agile Practices and Test Driven Development (TDD).</span><br />
<span style="text-align: justify;"><br /></span>
<br />
<div style="text-align: justify;">
2. Introduce JUnit. Many tutorials are available that introduce testing as well as JUnit. For example,<br />
http://www.vogella.com/tutorials/JUnit/article.html<br />
<span style="text-align: left;">http://realsearchgroup.org/SEMaterials/tutorials/junit/junit_tutorial_3.1.html</span><br />
<span style="text-align: left;"><br /></span>
Discuss the JUnit framework as well as the constructs that are part of JUnit. Usually, I get them to download required software and do the above after giving the click for 'Download'. At the end of the session, the students would have got the material and software ready to implement.<br />
<div>
<br /></div>
<div>
3. Start with the first exercise.</div>
</div>
<div style="text-align: justify;">
<br />
The students follows Test Driven Development methodology to write the test first (JUnit), which will fail. Run the code and check if it fails. Now, write the code that will pass the test. <br />
<br />
Write test cases and methods for all of the below methods : <br />
<div class="MsoNormal">
add(int a, int b)</div>
<div class="MsoNormal">
subtract(int a, int b)</div>
<div class="MsoNormal">
multiply(int a, int b)</div>
<div class="MsoNormal">
divide (int a, int b)<o:p></o:p><br />
<br /></div>
</div>
<div style="text-align: justify;">
If it is for novice level students, do not introduce 'Setup()' and 'TearDown()' methods. It is better to introduce in the next session. In case students have prior introduction to testing, it is better to get them to design and write test cases with setup() and teardown() methods in mind.</div>
<div style="text-align: justify;">
<br />
Evaluation : <br />
a. Check if student has considered the possible scenarios for setup() and teardown().<br />
b. Time taken for each session depends on the strength and weakness of the class. So, it has to be decided by the instructor.<br />
<br />
<br />
<i style="color: #660000;">Addendum : Please leave a comment. Suggestions, comments, discussions and queries are most welcome. </i></div>
</div>
Sapnahttp://www.blogger.com/profile/12978592679568478683noreply@blogger.com0tag:blogger.com,1999:blog-2350803350609391093.post-45821966998103252182016-06-23T00:09:00.003-07:002016-06-23T00:12:19.719-07:00Software Testing Lab - A First Exercise<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: justify;">
Along with writing posts about Software Testing, thought it would help if I could design a laboratory framework for students in parallel. So, in the Software Testing Lab Series, the objective is to look at aiding students applying techniques of testing in a laboratory set up. The scope involves defining objectives, links to reading material, exercises and evaluation.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<u>Session I :</u></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
1. The best way to get an idea of the skills of 'customers' in the software lab, is to test their knowledge in Software Testing. This can be done through a test, an objective test, which serves as a self-assessment mechanism for students and also gives the faculty an idea of student knowledge. It would be better that papers are interchanged and students themselves correct. It serves as reinforcement where correct answers are given, and a correction mechanism in cases of errors. Usually, I give fifteen questions, at three levels of difficulty - tough, medium, easy. The reason behind such a scheme is that even the weakest in the class will feel that through continuous work, (s)he can succeed in the lab - even then, some get intimidated :( A sample is given.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOc_P2f30BAzD0GaQV3O-y1zAksbPdmZU3aRZ5hAS3obeZJfALiRfR0mBgxdR01Nlbq9gtBPEUAm4ftoCIu0wYBcUUDvbVSaKIvo-ZL7reOT7Pcpu49W6RsgJZpEFqePMcrug_iP3KW3tl/s1600/merge_from_ofoct.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="282" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOc_P2f30BAzD0GaQV3O-y1zAksbPdmZU3aRZ5hAS3obeZJfALiRfR0mBgxdR01Nlbq9gtBPEUAm4ftoCIu0wYBcUUDvbVSaKIvo-ZL7reOT7Pcpu49W6RsgJZpEFqePMcrug_iP3KW3tl/s400/merge_from_ofoct.jpg" width="400" /></a></div>
<br />
<br /></div>
2. Give an outline of what is to be covered in the lab in 3 minutes. If there is a syllabi defined, introduce the syllabi. Otherwise, give an outline on the plan for the lab. Do remember to get a feedback.
<br />
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
3. Write a Java program called <b><i>Compute</i></b> that does the following operations on two integer inputs <b><i>a</i></b> and <b><i>b</i></b>.<br />
<div style="text-align: justify;">
<div class="MsoNormal">
</div>
<div class="MsoNormal">
add(int a, int b)</div>
<div class="MsoNormal">
subtract(int a, int b)</div>
<div class="MsoNormal">
multiply(int a, int b)</div>
<div class="MsoNormal">
divide (int a, int b)<o:p></o:p></div>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Write test cases for the above. Formulate the test cases in a table. </div>
</div>
<div style="text-align: justify;">
<br />
Evaluation : Check if the students have used Equivalence Class Partitioning techniques for designing test cases. If yes, they are on the right track. If not, discuss the technique and motivate them to rewrite. Exhaustive testing through large number of test cases must be dissuaded. Being the first exercise, possible test cases maybe listed and discussed.<br />
<br />
4. Manual testing may be done and results noted.<br />
<br /></div>
<div style="text-align: justify;">
<i style="color: #660000;">Addendum : Please leave a comment. Suggestions, comments, discussions and queries are most welcome. </i><span style="color: #660000;"> </span></div>
</div>
Sapnahttp://www.blogger.com/profile/12978592679568478683noreply@blogger.com1tag:blogger.com,1999:blog-2350803350609391093.post-36237558199993755512016-06-06T10:40:00.001-07:002016-06-08T02:40:41.247-07:00What is testing ?<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="background-color: white;"><span style="color: blue;">'Testing is the process used to check if something works'.</span></span> It happens every moment of our life. You clean a plate and you check if you have done it well, you paint a picture and you check if it meets your expectations, you cook and you taste to check if it turns out right. A bird builds its nest, testing if it is good enough, a rabbit digs a burrow and checks if it is good enough. So, testing is ubiquitous and is inbuilt in nature. So, it becomes imperative that software designed and developed needs to be tested.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbPBbYe0lH9PQxBzvodKZd_fCKydTthL4kuyBze2MW6WMfINRsko1Cl4lBwcA2rpnm3S3f8bxZUKILPpiiEeSYbDi6DcOXdvtQ2e_V-8eEf8q4wqTuaSq7HIjEeiy9D5VcY461S88o-2g_/s1600/stickman.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="282" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbPBbYe0lH9PQxBzvodKZd_fCKydTthL4kuyBze2MW6WMfINRsko1Cl4lBwcA2rpnm3S3f8bxZUKILPpiiEeSYbDi6DcOXdvtQ2e_V-8eEf8q4wqTuaSq7HIjEeiy9D5VcY461S88o-2g_/s320/stickman.png" width="320" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Testing is defined as the process of executing a program with the intent of finding bugs (i.e. error). Testing is also done to check how well something works (like the bird). It can also be defined as the process of validating and verifying to see if the program meets customer requirements. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
The word customer is generic. In the analogy used before, customers include 'you', birds kids and the rabbit herself. A program may work just fine but if it does not meet customers' requirement, then it is defective.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
A natural by-product of testing is increase in quality. As errors are unearthed and fixed, the quality of the software developed keeps improving.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Hence, testing can be defined as, <span style="color: blue;"> 'the process used to detect errors in the program ensuring quality'</span>.</div>
<br />
<i style="color: #660000; text-align: justify;">Addendum : Please leave a comment. Suggestions, comments, discussions and queries are most welcome. </i></div>
Sapnahttp://www.blogger.com/profile/12978592679568478683noreply@blogger.com0