Wednesday, July 21, 2010

SOA Testing

Sometime back, I had given a presentation on SOA Testing. You can view/download the ppt from following link:

SOA Testing PPT

Comments are welcome!

Tuesday, August 18, 2009

Getting Current Time on DB

To verify a bugs I had a need to get the current time on the Database
Server. Here are some SQL which might be useful.

Note: This is on Oracle DB

To get the server Date:

SELECT sysdate FROM dual;

This will give you the system date in this format, Ex: 18-AUG-09

To get the server TimeZone:

SELECT sessiontimezone FROM dual;

This will give you the system timezone in this format, Ex: Asia/Calcutta

To get the server time:

SELECT systimestamp FROM dual;

This will give you the system time in this format,
Ex: 18-AUG-09 04.49.43.648480000 AM -07:00

Monday, February 02, 2009

List Files in a directory


I remembered a good question which I was asked in one of my interviews some time back...

Write a program to list the files in a directory. The listed files should be greater than 1000 KB and it should be sorted.

This should take care of recursion also. Also write test cases for the same.

Here is what I came up with...

Java Program to List Files in a Directory.

/*
This program prints all the files in a directory(including sub directories recursively)
- more than 1000 KB - 1 KB = 1000 Bytes, 1000 KB = 1024000 bytes
- in descending order
*/

import java.io.*;
import java.util.*;

public class listFiles{
// Vector to hold all the list of files.
static Vector v1 = new Vector();
static boolean validdir = true;
public static void main(String[] args) {
// Get the directory name from the command line
if (args.length > 0 ) {
File dirName = new File(args[0].trim());
listFiles.listFilesinDir(dirName);
} else {
System.out.println("Enter a directory name.\n Usage: listFiles dirName");
validdir = false;
}
if (validdir) {
// Sort the Vector v1
Comparator comparator = Collections.reverseOrder();
// System.out.println("The List of files before sorting: " + v1);

Collections.sort(v1,comparator);
//System.out.println("The List of files after sorting in descending order : " + v1);
System.out.println("The Total Number of Files are: " + v1.size());

for (Enumeration e = v1.elements(); e.hasMoreElements();) {
System.out.println(e.nextElement());
}
}
} // end main()
public static void listFilesinDir(File fin) {
// Throw error if the directory does not exist.
if (!fin.exists()) {
validdir = false;
System.out.println(fin.getName() + " does not exist!!!");
return;
}
if (fin.isFile()) {
// 1 KB = 1000 Bytes, 1000 KB = 1024000 bytes
if (fin.length() > 1024000) {
// To print all files remove the comment in the below line.
// System.out.println(fin.getName());
// Add all the files into the vector.
listFiles.v1.add(fin.getName());
}
}
else if (fin.isDirectory()) {
String[] files = fin.list();
if (files == null) return;
for (int i=0; i


Here is the list of TestCases

A B C D E
1 Nu Test Case For Description Expected Results Remarks
2 1 Valid Dir Name Give a Valid Dir Name Should give the list of files Assume that size and ascending is taken care
3 2 Valid Dir Name - Order Check for Descending order The listed files should be in descending order Assume that size is taken care
4 3 Valid Dir Name - Size Check for the Size of Files The listed files should be greater than 1000 KB only Assume that ascending is taken care
5 4 Size - Boundary values Have a file of Exactly 1000 KB This file should be listed Assume that ascending is taken care
6 5 Size - Boundary values Have a file of Exactly 1001 KB This file should be listed Assume that ascending is taken care
7 6 Size - Boundary values Have a file of Exactly 999 KB This file should NOT be listed
8 7 Size - Low size Have a empty file/0 size This file should NOT be listed
9 8 Size - Low size Have a file of 1 KB size This file should NOT be listed
10 9 Size - Huge Size Have a file of 20000 KB This file should be listed Assume that ascending is taken care
11 10 Order Have files with names - a.txt, aa.txt, aaa.txt Observe that these should be sorted in descending order Assume that size is taken care
12 11 Order Have files with names - a.txt, b.txt, c.txt Observe that these should be sorted in descending order Assume that size is taken care
13 12 Dir Name -Space Let the directory name have space - ex: "Program Files" Should give the list of files Assume that size and ascending is taken care
14 13 Dir Name - Case Sensitive Have directories with case sensitive - ex: myDir1, mYdIR2 etc Should give the list of files Assume that size and ascending is taken care
15 14 Sub Directories Have many sub directories The sub directory names should NOT be listed
16 15 Sub Directories Have many sub directories The files inside the sub directories should be listed Assume that size and ascending is taken care
17 16 Sub Directories Have a sub directory with the "same name" as parent The files inside the sub directories should be listed Assume that size and ascending is taken care
18 17 Hidden Files Have some hidden files in the dir These should be listed Assume that size and ascending is taken care
19 18 Hidden Directory Specify a hidden dir as input The files inside a hidden dir should be listed Assume that size and ascending is taken care
20 19 Hidden sub directories Have some hidden sub directories inside the parent dir The files inside a hidden dir should be listed Assume that size and ascending is taken care
21 20 Read-Only Files Have some read only files in the dir These should be listed
22 21 Read-only Directory Specify a read-only dir as input The files inside a read-only dir should be listed Assume that size and ascending is taken care
23 22 Read-only Sub directories Have some read-only sub directories inside the parent dir The files inside a read-only dir should be listed Assume that size and ascending is taken care
24 23 Empty Dir Give a valid dir name - but empty one No Files should be listed
25 24 Dir Name - Special Chars Have some special chars in the name of the dir Should give the list of files Assume that size and ascending is taken care
26 25 Sub Directories - Breadth Have many sub directories in the parent dir… Have a breadth of say 10-20 dirs.
and files inside those directories
Should give the list of files Assume that size and ascending is taken care
27 26 Sub Directories - Depth Have a sub directoy inside a sub directory inside a sub dir…. Have a depth of say 10-20 dirs.
and files inside those directories
Should give the list of files Assume that size and ascending is taken care
28 27 Shared Dir in Windows Specify a shared directory Should give the list of files Assume that size and ascending is taken care
29 28 Specify the URI as dir name A dir on the intranet - ex: \\10.192.23.212\myDir1 Should give the list of files if accessible Assume that size and ascending is taken care
30 29 Dir Name - "." Specify "." as the dir name Should give the list of files in the current dir Assume that size and ascending is taken care
31 30 Dir Name - ".." Specify ".." as the dir name Should give the list of files in the parent dir Assume that size and ascending is taken care
32 31 Dir Name - Absolute Path - Forward Slash Specify "C:/Testing/MyDir1" as the dir name Should give the list of files Assume that size and ascending is taken care
33 32 Dir Name - Absolute Path - Back Slash Specify "C:\Testing\MyDir1" as the dir name Should give the list of files Assume that size and ascending is taken care
34 33 Dir Name - Relative Path - Forward slash Specify "MyDir1/MyDir2/MyDir3" as the dir name Should give the list of files Assume that size and ascending is taken care
35 34 Dir Name - Relative Path - Backward slash Specify "MyDir1\MyDir2\MyDir3" as the dir name Should give the list of files Assume that size and ascending is taken care
36 35 Dir Name - Relative Path Specify "..\..\MyDir2\MyDir3" as the dir name Should give the list of files Assume that size and ascending is taken care
37 36 Dir Name - integer The dir name is "12345" Should give the list of files Assume that size and ascending is taken care
38 37 Dir Name - very long name Ex: The dir name is "Thisismydirectoryandthenameisverybig" Should give the list of files Assume that size and ascending is taken care
39 38 Negative Test Specify some file name as input Throw error message
40 39 Negative Test Specify some non existing dir name Throw error message
41 40 Negative Test Specify null Throw error message
42 41 Formats All possible format files should be listed - ex: ".zip" ".doc" ".pdf" etc Should give the list of files Assume that size and ascending is taken care
43 42 Negative Test Specify a zip file as input Throw error message
44 43 Negative Test Specify the dir name + some blanks Should trim
45




46
Unix/Linux


47 44 Perform all the above tests for Linux/Unix; Also perform the below special cases for Unix


48




49 45 Dir Name - Mounted dir Specify a mounted dir as the input dir name Should give the list of files Assume that size and ascending is taken care
50 46 Dir Name - Case Sensitive Have directories with case sensitive - ex: myDir1, mYdIR2 etc Should give the list of files Assume that size and ascending is taken care
51 47 Read-Only Files Have some read only files in the dir These should be listed
52 48 Read-only Directory Specify a read-only dir as input The files inside a read-only dir should be listed Assume that size and ascending is taken care
53 49 Read-only Sub directories Have some read-only sub directories inside the parent dir The files inside a read-only dir should be listed Assume that size and ascending is taken care
54 50 Dir Name - Special Chars Have some special chars in the name of the dir Should give the list of files Assume that size and ascending is taken care
55 51 Dir Name - "." Specify "." as the dir name Should give the list of files in the current dir Assume that size and ascending is taken care
56 52 Dir Name - ".." Specify ".." as the dir name Should give the list of files in the parent dir Assume that size and ascending is taken care
57 53 Dir Name - Absolute Path - Forward Slash Specify "/opt/testing/MyDir1" as the dir name Should give the list of files Assume that size and ascending is taken care
58 54 Dir Name - Absolute Path - Back Slash Specify "opt\testing\MyDir1" as the dir name Should give the list of files Assume that size and ascending is taken care
59 55 Dir Name - Relative Path - Forward slash Specify "MyDir1/MyDir2/MyDir3" as the dir name Should give the list of files Assume that size and ascending is taken care
60 56 Dir Name - Relative Path - Backward slash Specify "MyDir1\MyDir2\MyDir3" as the dir name Should give the list of files Assume that size and ascending is taken care
61 57 Dir Name - Relative Path Specify "..\..\MyDir2\MyDir3" as the dir name Should give the list of files Assume that size and ascending is taken care
62




63
Performance Testing


64 58 50,000 Files( all > 1000 KB) Have a dir with 50,000 Files Should give the list of files - check for breakdown Assume that size and ascending is taken care
65 59 50,000 Files > 1000 KB + 50,000 Files < 1000 KB Have a dir with 50,000 Files > 1000 KB and 50,000 Files < 1000 KB Should give the list of files - check for breakdown Assume that size and ascending is taken care
66




67 60 10,000 Sub directories Have 10,000 sub directories with files Should give the list of files - check for breakdown Assume that size and ascending is taken care








Sunday, January 18, 2009

Testing Private methods

Hi,
Here is a good article on testing private methods...

http://www.artima.com/suiterunner/private.html

-ahamad

Thursday, September 18, 2008

Code coverage tool for UI

I was looking for a code coverage tool for Java based UI, I came across this tool – ECLEmma.

EclEmma is a free Java code coverage tool for Eclipse, available under the Eclipse Public License.

home page : http://www.eclemma.org/

Below are the steps that are to be followed to setup EclEmma for code coverage:

  1. Open Eclipse; Goto "Help->Software Updates->Find and Install" menu
  2. Click "Next >" In Install window and add a new remote site by clicking on "New Remote Site" button
  3. Enter any name and specify the URL as http://update.eclemma.org
  4. Click finish to search and install the EclEmma Java Code Coverage plug-in
  5. Restart Eclipse when prompted
  6. Now a new icon can be seen next to Run or Debug icons.

  1. Click on arrow next to Coverage icon and select "Open Coverage Dialog"
  2. Select “Eclipse Application” and click on “New” to create a new configuration.
  3. Goto "Coverage" tag and select only the packages in which the source for your feature is checked-in. You can contact the developer or see the folders in changelists to know the list of all packages used by the feature.
  4. Click on "Apply" after all the required packages are selected and then on "Coverage" button to launch your app in "Code Coverage" mode.
  5. Conduct Manual / Automated testing to cover the feature that you are trying to test and close your app.
  6. Now you can see a new tab with the name "Coverage" near "Console" or "Problems" tab
  7. Navigate to exact Java files where the source of your feature is written and check out the percentage of coverage done.
  8. You can double-click on Class or Function to navigate to corresponding Java file and see what parts of code were not exercised and write more test cases to cover the un-exercised code.
  9. You can export the whole of Coverage results to HTML format by right-clicking on any row and selecting "Export Session"
  10. You can have multiple sessions and then you can merge them together.

Monday, April 21, 2008

ICSPI 2008 - Call for presentations and Full day tutorials


Call for presentations and Full day tutorials

ICSPI 2008
International Conference on Software Process Improvement

Washington D.C.
October 20-24, 2008

This year's ICSPI has a new focus. That is the SPI
Body of Knowledge and the Certified Software Process
Improvement Professional (CSPIP) program.

Tutorials offered at the conference will support the
SPI Body of Knowledge (SPIBOK).

The International Institute for Software Process (IISP)
with Guidance of its Advisory Board has just announced
the SPI Body of Knowledge and the requirements for the
CSPIP credentials.

ICSPI 2008 continues its "pragmatic" approach to SPI. Whether
you are adopting a formal assessment model or interested in
less formal process improvement approaches, ICSPI 2008 promises
to keep the same practical theme in all of its presentations
and tutorials. The program will feature presentations by world
leading authorities in software process improvement.


Important Dates

April 21, 2008: Proposals for full day tutorials are due.
Please see guidelines at www.icspi.com. Tutorial proposal
supporting the SPIBOK will be given priority. Details on the
SPIBOK can be found at www.SPInstitute.org

April 28, 2008: Proposals for papers and presentations are due

May, 30,2008: Notification of acceptance will be mailed out

July 11, 2008: Copies of presentations and/or papers are due

October 21 & 22, conference presentations
(pre- and post conference tutorials will be conducted
October 20th, 23rd, and 24th.

Topics of interest include:

* Defining and Documenting Software Processes
* Measuring Software Processes
* Evaluating Software Process Capability and Effectiveness
* Planning and Managing an SPI Program and SPI Projects
* Implementing Software Process Change
* Software Engineering Topics
* Quality Assurance and Testing Topics
* Requirement Engineering and Management
* Software Development, Integration, Release, and Support
* Configuration Management
* Project Management and Planning
* Risk Management
* Verification and Validation Methods
* Agile Software Development Methods
* Software Quality Assurance
* Balanced Scorecard
* Software Measurement & Analysis
* Internal and External Assessment
* CMMI Experience
* SEPG Experience
* Quality Management and Process Management
* Lean SPI
* Six Sigma
* Formal or informal appraisals
* Defect Prediction and Prevention
* ISO
* Human Resource Development
* Inspections and Peer Reviews

Proposals dealing with other topics will also be considered.

All accepted proposals are awarded a free admission to the
two-day conference and a copy of the conference proceedings.
In addition, the best paper or presentation as judged by the
conference delegates will be invited as a featured presentation
in the following conference.

SUBMISSION RULES
=================

* Your proposal must follow ALL standards and procedures below
completely in order to be considered for the review process.

* The acceptance of your proposal does NOT guarantee acceptance
of your presentation. Timely receipt of the full presentation
material is required for you to present.

* Submitting a Proposal implies that you will be available to
make the presentation at the conference, including getting approval
from your company and meeting any international travel requirements.

* If your proposal is accepted and you are not able to present
at the conference for any reason, the acceptance decision will be
reversed.

* The presentation must fully address your proposal objectives
and outline.

Proposals From Outside the U.S.
===============================

All proposals submitted by individuals living outside the U.S., must be accompanied by the following two items:

1. A proof that the speaker holds a Visa to the U.S. to deliver the presentation

2. A proof of financial support from Employer indicating that Employer will cover travel expenses for speaker(s) to deliver presentation in the U.S.

Non-U.S. proposals will not be considered for review without these items

Proposal Standards and Procedures:
===================================
All proposals must be sent via e-mail to the Conference Chair,
Dr. Magdy S. Hanna at mhanna@icspi.com as follows:

Please do NOT reply to this message with you proposal.

* One file in MS Word or RTF format containing all items listed below
* One file in MS Word or RTF format containing the paper if submitted
* One file in PowerPoint format containing the presentation if submitted

DO NOT INCLUDE ANY PART OF YOUR SUBMISSION IN THE BODY OF THE MESSAGE

NO PROPOSAL WILL BE CONSIDERED FOR REVIEW IF ANY OF THE ITEMS BELOW IS MISSING.

1. Presentation Title

2. Presenter Information: Name, Title, Company, Address, Phone, Fax, E-mail

3. A detailed bio listing all experience related to the subject of the proposal.

4. Will you provide a paper with the presentation: (Y/N)

5. Has this paper or presentation been delivered or published elsewhere? (Y/N) If yes, list Event(s) and/or Publication, Dates

6. Background, context or rationale for your proposal

7. Key concepts to be presented

8. Learning Objectives (Results) for participants - what they will
learn and/or how they will benefit from your presentation

9. OUTLINE: Full, detailed, bulleted outline of the Presentation.
This should highlight all in the presentation and their logical
flow and development. This is will be used for the web site
if your proposal is chosen,

Proposals and presentations must meet the following guidelines

1. Do not include any company specific terms or acronyms unless defined

2. Must focus on what can be learned

3. Must not propose any introductory or text-book type material

4. The focus must be on specific experiences rather than vague advice

5. Must not promote any service or products


PROPOSAL REVIEW
==================
Your Proposal will be reviewed by The Conference Review Board.
If you have any questions, please address them to the Conference Chair,
Dr. Magdy Hanna, Mhanna@icpi.com