Monday, May 16, 2011

Lovely Wedding Song & performance

I loved every bit of it ... I wish I wish I'll be able to do so when i get married

Java IO - File Size

package file_space;
import java.io.*;
public class file_size {


public long file_size_bytes(long file_size)
{
return (long) (file_size);
}

public long file_size_KB(long file_size)
{
return (file_size/1024);
}

public long file_size_MB(long file_size)
{
return (file_size/1024/1024);
}

public long file_size_GB(long file_size)
{
return (file_size/1024/1024/1024);
}

public static void sop(Object str)
{
System.out.println("File Size on Drive is "+str);
}
public static void main(String args[])
{
File file=new File("files/file_txt.txt");
//System.out.println(file.exists());
//System.out.println(file.getAbsolutePath());

//Long bytes=file.length();
Long bytes=file.getFreeSpace();
file_size fs=new file_size();

sop(fs.file_size_bytes(bytes)+" Bytes");
sop(fs.file_size_KB(bytes)+" KB");
sop(fs.file_size_MB(bytes)+" MB");
sop(fs.file_size_GB(bytes)+" GB");

}



}

Saturday, May 14, 2011

What is a test case?

Test Case


The very word "testcase" to a lay person could be expanded as "Testing" a "Case".
A Case is an occurrence of sequence of steps leading to an observation(output).

Testing is synonymous with verification and validation of the outcome of the sequence of steps.

Putting together these two definitions, we can further simplify and elaborate test case as
"A sequence of steps that performed leads to an observation that needs to be verified for its validity".



Test Case is a term coined by the field of Software Engineering. Its purpose is to drill down to a simpler units of tests. You could check for the definition defined by wikipedia over here


Example :

When you to a pharmacy to buy a drug(medicine), you verify the M.R.P(Maximum Retail Price) and the Expiry Date of the drug(medicine) purchased.

Test Cases for a Drug purchased would then look like :
1) Verify that the Selling Price of the Drug by the pharmacy <= M.R.P of the drug being sold
2) Verify that the Date of Expiry is lesser than today's date.