Future of Software Testing

His ears were ringing, his head throbbing with pain. As he came to his senses, he looked around the trashed cockpit, trying to locate a way out. He could not detect any movements behind him; probably the co-pilot was still knocked out by the crash, or even worse: dead. The ejection sequence had never initiated; after the hydraulic failure, the plane had simply not responded to any directives. A week later after he had been rescued from the crash site, the pilot learnt that the hydraulic failure had lead to the software failure, which had resulted in the crash. If the software had been tested more rigorously, the software would have switched to the backup hydraulic system, leading to a safe return of the air craft and its pilots.

It is common knowledge that most of our algorithms cannot be mathematically proven. During the development and once the software is designed, it is tested for most types of possible bugs, but not all of them. Re-creating all types of possible conditions and events is just not economically or technologically feasible. Thus software testing is one of the most important branches of computer programming, for one has to check the software of the appropriate number of tests, with which the software programmed, can be used without too much un-reliability for the end user. Software testing has evolved over the years from in-source testing to outsource testing. Currently a new testing phase is being deployed, known as crowd sourcing, which allows testers all over the world to test different softwares being developed on different platforms, multiple environments and on a wide range of hardware.

However this does not end here. Crowd sourcing may be far better than out sourcing in terms of number of testers being used and the types of environments it is tested on, but it is still not effective enough. The first problem it faces is the lack of information provided by the software about some of the errors. This becomes a big problem, as the bug in the software could lie anywhere in the code, and finding and fixing it becomes a technical and financial nightmare. To prevent such bugs, new development environments are predicted, which will interact with the developer; alerting about the possible bugs while developing and testing the software. A popular concept of such a visualization is the THUD, Testers Heads Up Display, which like in computer and console games will aid in presentation of information for the developer. Also, languages will have improved versions of exception handling functions, which will allow the bugs to be categorized more appropriately; they will tend to be specific for every method rather than being used for chunks of code.

Another problem with crowd sourcing is the amount of data sent by the tester to the developer. At times, the developer fixing the problem is just unable to reproduce the bug encountered by the tester. Such bugs may be marked as nopro and are usually neglected. To overcome this hurdle, the concept of virtualization models is being considered. Virtual environments will allow the end user to transfer the whole environment to the tester or developer, who can look straight into the problem without having to re-create it. It not only saves a lot of time and money, but also is very feasible for those bugs which are difficult to re-produce.

Then there is the problem of a collection of tests for a particular type of software or a piece of code. Every programmer or tester performs different tests on the software, but each one has his own library. Also, test cases are too dependent on specific test platforms or application and they require specific tools which other testers may not have. To correct these problems we require a common testing base, which can collect data and re-use it no matter what the application or the environment may be. To do this virtualization, again, provides a solution.

Using virtualization:

“Test cases will be written within virtual capsules that embed all the necessary environmental dependencies so that the test case can run on whatever machine you need it to run on.”

[http://blogs.msdn.com/james_whittaker/archive/2009/01/16/test-case-reuse-in-the-future.aspx]

Indeed this will allow the testers to create a library for all the test cases, which can be applied on any piece of code written.

Software testing is becoming more important than ever. Software testers are gaining recognition and software testing has become a core branch in software development. Firms have started to realize that good software not only has to have functionality, but stability as well. Software testing is no longer a simple test at the end of the software development period; it has become software development.

Mashhood Ali Rastgar
University College London

A MIPS calculator

One of my other modules this year included a Computer Architecture course, which included some basic assembly programming in the first part and some hardware basics in the second part. The assembly language we learnt was MIPS, and used the SPIM simulator to test the programming. Our final project was a simple MIPS calculator which I have uploaded below. Got an A grade in this one tooo!

[sourcecode language=”css”]
.data

str0: .asciiz "nWelcome to Interactive Calculator 1.0"
str1: .asciiz "nn Enter first value: "
str2: .asciiz " Enter (+, -, /, *): "
str3: .asciiz "n Enter second value: "
str4: .asciiz "n Invalid Operator! Try again. "
str5: .asciiz "n Answer is: "
str6: .asciiz "nn Another Calculation? y, n: "
str7: .asciiz "nn Invalid input! Please enter y or n."
str8: .asciiz "nn Calculator Terminated."

.text
.globl main

main:
addi $v0, $0, 4

la $a0, str0

syscall #printing str0

calc:

addi $v0, $0, 4

la $a0, str1

syscall #printing str1

addi $v0, $0, 6

syscall
mov.s $f1, $f0 #reading and storing first value

addi $v0, $0, 4

la $a0, str2

syscall #printing st2

addi $v0, $0, 12

syscall #reading operator

add $a1, $v0, $0 #storing operator

addi $v0, $0, 4

la $a0, str3
syscall #printing str3

addi $v0, $0, 6

syscall
mov.s $f2, $f0 #reading and storing second value

addi $9, $0, 0x2b
beq $a1, $9, addIt #checking if +

addi $9, $0, 0x2d
beq $a1, $9, subIt #checking if –

addi $9, $0, 0x2a
beq $a1, $9, mulIt #checking if *

addi $9, $0, 0x2f
beq $a1, $9, divIt #checking if

addi $v0, $0, 4

la $a0, str4

syscall #printing str4
j calc

addIt:
add.s $f12, $f1, $f2 #adding values
j printAnswer

subIt:
sub.s $f12, $f1, $f2 #subtracting values
j printAnswer

mulIt:
mul.s $f12, $f1, $f2 #multiplying values
j printAnswer

divIt:
div.s $f12, $f1, $f2 #dividing values
j printAnswer

printAnswer:
addi $v0, $0, 4

la $a0, str5

syscall #printing str5

li $v0, 2
syscall #printing answer
j anotherCalc

anotherCalc:
addi $v0, $0, 4

la $a0, str6

syscall #printing str6

addi $v0, $0, 12

syscall #reading command

add $a1, $v0, $0 #storing command

addi $9, $0, 0x79
beq $a1, $9, calc #checking if y

addi $9, $0, 0x6e
beq $a1, $9, exitApp #checking if n

addi $v0, $0, 4

la $a0, str7

syscall #printing str7
j anotherCalc

exitApp:
addi $v0, $0, 4

la $a0, str8

syscall #printing str8
jr $31 # Exit main subroutine.
[/sourcecode]

My Groovy Project

well i have finally got some time to upload my groovy project. This was my modules final project, a simple inventory system. It has no Object Orient implementations, but has a simple GUI. The sample data file and a readme is included in the zip. n yeah.. I got an A grade for this! :D..

Link to project is here.

a Groovy GUI Calculator…

a whole term studying Groovy..and i am finally ready. I finished my term project a few weeks back, am planning to upload it, but waiting for the results before I do. However this calculator has a simple GUI, basic functions, just to refresh my Groovy, esp the gui part. Plus I will be using it in my second term while programming Java..(and i wanted a more efficient code.. but then i cudnt be bothered..)

[sourcecode language=”groovy”]
import groovy.swing.SwingBuilder
import java.awt.GridLayout
import java.awt.BorderLayout
import javax.swing.JOptionPane

def GUI = new CalcGUI()

public class CalcGUI {
def swing = new SwingBuilder()

def operatorCheck = ""
def temp1 = ""
def type1 = { swing.updateValue.text = swing.updateValue.text + ‘1’ }
def type2 = { swing.updateValue.text = swing.updateValue.text + ‘2’ }
def type3 = { swing.updateValue.text = swing.updateValue.text + ‘3’ }
def type4 = { swing.updateValue.text = swing.updateValue.text + ‘4’ }
def type5 = { swing.updateValue.text = swing.updateValue.text + ‘5’ }
def type6 = { swing.updateValue.text = swing.updateValue.text + ‘6’ }
def type7 = { swing.updateValue.text = swing.updateValue.text + ‘7’ }
def type8 = { swing.updateValue.text = swing.updateValue.text + ‘8’ }
def type9 = { swing.updateValue.text = swing.updateValue.text + ‘9’ }
def type0 = { swing.updateValue.text = swing.updateValue.text + ‘0’ }
def typeClr = { swing.updateValue.text = ” }
def optPlus = { temp1 = swing.updateValue.text;operatorCheck = ‘+’; typeClr();}
def optSub = {temp1 = swing.updateValue.text;operatorCheck = ‘-‘; typeClr();}
def optMul = {temp1 = swing.updateValue.text;operatorCheck = ‘*’; typeClr();}
def optDiv = {temp1 = swing.updateValue.text;operatorCheck = ‘/’; typeClr();}
def calculate = {
def temp2 = swing.updateValue.text;
temp1 = temp1.toInteger()
temp2 = temp2.toInteger()
if(operatorCheck == "") { JOptionPane.showMessageDialog(null, ‘Operator Error!’)}
if(operatorCheck == ‘+’) { swing.updateValue.text = temp1 + temp2;operatorCheck=""}
if(operatorCheck == ‘-‘) { swing.updateValue.text = temp1 – temp2;operatorCheck=""}
if(operatorCheck == ‘*’) { swing.updateValue.text = temp1 * temp2;operatorCheck=""}
if(operatorCheck == ‘/’) { swing.updateValue.text = temp1 / temp2;operatorCheck=""}
temp2 = ""
}

def frameButtons = {

swing.panel(layout :new BorderLayout(), constraints : BorderLayout.NORTH) {
textField(id : ‘updateValue’, columns : 20)
}
swing.panel(layout :new GridLayout(4, 4, 1, 1), constraints : BorderLayout.CENTER) {
button(text : ‘1’, actionPerformed : type1)
button(text : ‘2’, actionPerformed : type2)
button(text : ‘3’, actionPerformed : type3)
button(text : ‘+’, actionPerformed : optPlus)
button(text : ‘4’, actionPerformed : type4)
button(text : ‘5’, actionPerformed : type5)
button(text : ‘6’, actionPerformed : type6)
button(text : ‘-‘, actionPerformed : optSub)
button(text : ‘7’, actionPerformed : type7)
button(text : ‘8’, actionPerformed : type8)
button(text : ‘9’, actionPerformed : type9)
button(text : ‘*’, actionPerformed : optMul)
button(text : ‘Clr’, actionPerformed : typeClr)
button(text : ‘0’, actionPerformed : type0)
button(text : ‘=’, actionPerformed : calculate)
button(text : ‘/’, actionPerformed : optDiv)

}
}

def frameMenu = {
swing.menuBar() {
menu(text: "File", mnemonic: ‘F’) {
menuItem(text: "Exit", mnemonic: ‘X’, actionPerformed: {System.exit(0)})
}

}
}

// creating frame and dialog of remaining objects
def frame = swing.frame(title: ‘Caculator 1.0’, size: [300, 400], show: true, locationRelativeTo: null) {
frameMenu()
frameButtons()
}
}
[/sourcecode]

of Groovy Swing Lists..

my first course work with Groovy was a small inventory management program, which was suppose to be all command line based. However, I thought it would be fun to implement some GUI as well.. and thus I ventured into the Javax Swing world where a thing as simple as displaying a list (or a JList) can be ones worst nightmare. The code below took me 90 mins to compile!.. n I was just trying to display a list! :@

 

[code]

String[] data = ["one", "two", "three", "four", "five", "six", "seven", "eight"];

listbox = new JList(data);
listbox.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
listbox.setVisibleRowCount(2);
listbox.ensureIndexIsVisible(2);

scrollPane (layout : new ScrollPaneLayout())    {
dBox = list(listbox, visibleRowCount : 2, autoscrolls : true)
}

[/code]

imars.info : Updated!

its been almost a year since i last updated my website.. and finally this year with my GCSEs out of the way.. i had 3 long months to get updated with the latest tech.. n then deploy my website.. n after alot of coding and messing arnd i have finally completed the site!! Visit: http:imars.info to check it out..

I have implemented the following scripts in my new site:
– ASP 3.0
– AJAX
– CSS/xHTML
– JScript
– n JQuery

Adding Network printer to Mac OS 10.5

my dad recently swtiched to mac os on his macbook.. (he was previously using Windows XP on it! :O).. he was using it in this office.. and he needed to connect to a network printer through WIFI.. the computer on which the printer was installed was a PC.. n the printer was an HJ LaserJet 1200.. i started tampering with the settings.. but even then.. it took me about 40 mins to locate and install the printer!.. the procedure is simplified as below:

Adding a new printer to Mac OS 10.5 Leopard:

follow: System Preferences – Printer and Fax – use the + button to add a new printer.

– click on the Windows Tab, wait for the network workgroups/domains to show up

– click on the desired Workgroup/Domain, wait (upto a few mintues) for the connected computers to show. (if nothing shows, check ur connection, try pinging the network computers, or see if they are showing in Finder)

– select the computer on which the printer is installed.

– if asked for password, (on domain use Windows User Accounts ID and Password) enter Administrator in Name field and leave password blank. (default work group settings for windows).

– check the Remember this password in my keychains

– on the lower end: Use Driver – Select from a list – select ur printer driver from the list (if not found, u will have to download and install the driver manually from printer company site)

– click Add button

Your printer has now been setup sucessfully.  Enjoy printing!

AJAX ASP Tutorial…

about two years ago, a good friend of mine (snuke –http://alizahid.net/) sent me a ZIP file containing the AJAX tutorial… i have finally mastered the script (it didnt actually take me two years!.. i was busy with my GCSEs).. and its time for me to pass the information on. The code below links to the slightly updated file of wht snuke sent me.. run the code thru IIS and it shud work smoothly…

The HTML File: index.html

[sourcecode language=’html’]


Welcome to the ajax tutorial

Welcome to the ajax tutorial…

The following link are linked to AJAX Functions. Click to test:

Test1 Test2 Test3
Div1 Div2 Div3


[/sourcecode]

CSS File: style.css

[sourcecode language=’css’]
html {
background:#000000;
}

body {
color: #FFFFFF;
background: #000000;
cursor: default;
font-family: Calibri;
font-size: 16px;
letter-spacing: .2em;
margin: 0px;
}

a {
text-decoration: none;
color: #F0F0F0;
}

a:hover {
color: #FFFFFF;
}

#wrapper {
width: 820px;
margin: auto;
}

#page {
width: 75%;
margin-left: 5px;
float: left;
background: #222222;
padding: 10px;
-webkit-border-bottom-left-radius: 3px;
-webkit-border-bottom-right-radius: 3px;
}

.myBox {
background: #585858;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border: #AAAAAA solid 2px;
padding: 10px;
margin: auto;
color: “#FFFFFF” ;
font-family: tahoma;
}

#footer {
clear: both;
float: left;
margin-top: 10px;
padding: 5px;
font-size: 9px;
text-align: right;
background: #222222;
-webkit-border-bottom-right-radius: 3px;
-webkit-border-top-right-radius: 3px;
}

.spinner {
padding: 5px;
}

.tbox{
background:#000000;
color:#666666;
border: 1px solid #666666;
height: 25px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
}

.style1 {
text-align: center;
}
[/sourcecode]

Javascript File: java.js

[sourcecode language=’jscript’]

var spinner = ‘Loading…’;

function page(page,target) {

document.getElementById(target).innerHTML = spinner;
xmlHTTP = GetxmlHTTPObject()

if (xmlHTTP == null) {
alert(“Your browser does not support AJAX!”);
return;
}

var url = “core.asp?”;
url = url + page;

xmlHTTP.onreadystatechange = function(){
if (xmlHTTP.readyState == 4) {
document.getElementById(target).innerHTML = xmlHTTP.responseText;
}
}

xmlHTTP.open(“GET”, url, true);
xmlHTTP.send(null);
}

function GetxmlHTTPObject() {
var xmlHTTP = null;

try {
xmlHTTP = new XMLHttpRequest();
}

catch (e) {
try {
xmlHTTP = new ActiveXObject(“Msxml2.XMLHTTP”);
}
catch (e) {
xmlHTTP = new ActiveXObject(“Microsoft.XMLHTTP”);
}
}
return xmlHTTP;
}

[/sourcecode]

and finally the ASP file: core.asp

[sourcecode language=’vb’]

<% If Request.ServerVariables("QUERY_STRING") = "test1" Then %>
This links to Test1
<% End If %>

<% If Request.ServerVariables("QUERY_STRING") = "test2" Then %>
This links to Test2
<% End If %>

<% If Request.ServerVariables("QUERY_STRING") = "test3" Then %>
This links to Test3
<% End If %>

[/sourcecode]

Of Animation, Popups and Timers..

Unfortunately my laptop is now unable to run the Visual Basic 2008 Express Edition.. so I am back at my web development.  I was fixing some bugs on my mums site (http:ammisrecipes.com) when I saw I needed some popups to give certain notifications.  Thus I started working on the popups, adding a fade out effect and a timer to close it automatically after two seconds. Fadeout timer and the visual settings can be changed from the respective css and js files.

CSS file: style.css

[sourcecode language=’css’]
html {
background:blue;
}

body {
color: black;
margin: 15px;
align:center;
}

#styled_popup {

background:yellow;
width: 350px;
height: 100px;
display:none;
position: absolute;
top: 100px;
left: 300px;
zoom: 1;
-webkit-border-radius: 5px;

margin:10px;
color:black;
}
[/sourcecode]

JS File: ani_popup.js

[sourcecode language=’jscript’]
var mins,secs,TimerRunning,TimerID;
TimerRunning=false;

function StopTimer()
{
if(TimerRunning)
clearTimeout(TimerID);
TimerRunning=false;
}

function StartTimer()
{
TimerRunning=true;
TimerID=self.setTimeout(“StartTimer()”,1000);
Check();

if(mins==0 && secs==0)
StopTimer();

if(secs==0)
{
mins–;
secs=60;
}
secs–;

}

function Check()
{
if(mins==0 && secs==0)
{
return fadeOutMyPopup();
}
}

// Browser safe opacity handling function
function setOpacity( value ) {
document.getElementById(“styled_popup”).style.opacity = value / 10;
document.getElementById(“styled_popup”).style.filter = ‘alpha(opacity=’ + value * 10 + ‘)’;
}

function fadeInMyPopup() {
for( var i = 0 ; i <= 100 ; i++ ) setTimeout( 'setOpacity(' + (i / 10) + ')' , 8 * i ); } function fadeOutMyPopup() { for( var i = 0 ; i <= 100 ; i++ ) { setTimeout( 'setOpacity(' + (10 - i / 10) + ')' , 8 * i ); } setTimeout('closeMyPopup()', 800 ); } function closeMyPopup() { document.getElementById("styled_popup").style.display = "none" } function fireMyPopup() { setOpacity( 0 ); document.getElementById("styled_popup").style.display = "block"; fadeInMyPopup(); mins=0; secs=2; StopTimer(); StartTimer(); } [/sourcecode] HTML File: Popup.html [sourcecode language='html']

Animated Popups

Your entry has been updated.



[/sourcecode]