Software Development Life Cycle (SDLC)

What is Software Development Life Cycle (SDLC)

SDLC Model

SDLC is a process followed for a software project, within a software organization. It consists of a detailed plan describing how to develop, maintain, replace and alter or enhance specific software. The life cycle defines a methodology for improving the quality of software and the overall development process.

The following figure is a graphical representation of the various stages of a typical SDLC.
sdlc process

A typical Software Development life cycle consists of the following stages:

Stage 1: Planning and Requirement Analysis

Requirement analysis is the most important and fundamental stage in SDLC. It is performed by the senior members of the team with inputs from the customer, the sales department, market surveys and domain experts in the industry. This information is then used to plan the basic project approach and to conduct product feasibility study in the economical, operational, and technical areas.

Planning for the quality assurance requirements and identification of the risks associated with the project is also done in the planning stage. The outcome of the technical feasibility study is to define the various technical approaches that can be followed to implement the project successfully with minimum risks.

Stage 2: Defining Requirements

Once the requirement analysis is done the next step is to clearly define and document the product requirements and get them approved from the customer or the market analysts. This is done through .SRS. . Software Requirement Specification document which consists of all the product requirements to be designed and developed during the project life cycle.

Stage 3: Designing the product architecture

SRS is the reference for product architects to come out with the best architecture for the product to be developed. Based on the requirements specified in SRS, usually more than one design approach for the product architecture is proposed and documented in a DDS – Design Document Specification.

This DDS is reviewed by all the important stakeholders and based on various parameters as risk assessment, product robustness, design modularity , budget and time constraints , the best design approach is selected for the product.

A design approach clearly defines all the architectural modules of the product along with its communication and data flow representation with the external and third party modules (if any). The internal design of all the modules of the proposed architecture should be clearly defined with the minutest of the details in DDS.

Stage 4: Building or Developing the Product

In this stage of SDLC the actual development starts and the product is built. The programming code is generated as per DDS during this stage. If the design is performed in a detailed and organized manner, code generation can be accomplished without much hassle.

Developers have to follow the coding guidelines defined by their organization and programming tools like compilers, interpreters, debuggers etc are used to generate the code. Different high level programming languages such as C, C++, Pascal, Java, and PHP are used for coding. The programming language is chosen with respect to the type of software being developed.

Stage 5: Testing the Product

This stage is usually a subset of all the stages as in the modern SDLC models, the testing activities are mostly involved in all the stages of SDLC. However this stage refers to the testing only stage of the product where products defects are reported, tracked, fixed and retested, until the product reaches the quality standards defined in the SRS.

Stage 6: Deployment in the Market and Maintenance

Once the product is tested and ready to be deployed it is released formally in the appropriate market. Sometime product deployment happens in stages as per the organizations. business strategy. The product may first be released in a limited segment and tested in the real business environment (UAT- User acceptance testing).

Then based on the feedback, the product may be released as it is or with suggested enhancements in the targeting market segment. After the product is released in the market, its maintenance is done for the existing customer base.

Visit Best Software Technologies Online Training with Real time Projects

Writing and Running First Java Program

In the Java programming language, all source code is first written in plain text files ending with the .java extension. Those source files are then compiled into .class files by the javac compiler [the name of the class files is same that of the class defined]. A .class file does not contain code that is native to the processor; it instead contains bytecodes — the machine language of the Java Virtual Machine1 (Java VM). The java.exe launcher tool then runs the application with an instance of the Java Virtual Machine.

Because the Java VM is available on many different operating systems, the same .class files are capable of running on Microsoft Windows, the Solaris TM Operating System (Solaris OS), Linux, or Mac OS.

Through the Java VM, the same application is capable of running on multiple platforms.

The Java Platform

A platform is the hardware or software environment in which a program runs. We’ve already mentioned some of the most popular platforms like Microsoft Windows, Linux, Solaris OS, and Mac OS. Most platforms can be described as a combination of the operating system and underlying hardware. The Java platform differs from most other platforms in that it’s a software-only platform that runs on top of other hardware-based platforms.

If you wanna watch Core Java Videos free of cost, you can go for this link: http://www.bestdotnettraining.com/core-java-online-training

The Java platform has two components:

The Java Virtual Machine

The Java Application Programming Interface (API)

The API is a large collection of ready-made software components that provide many useful capabilities. It is grouped into libraries of related classes and interfaces; these libraries are known as packages.

The API and Java Virtual Machine insulate the program from the underlying hardware.

As a platform-independent environment, the Java platform can be a bit slower than native code. However, advances in compiler and virtual machine technologies are bringing performance close to that of native code without threatening portability.

Step 1. Create a Source File

/**

* The HelloWorld class implements an application that

* simply prints “Hello World!” to standard output.

*/

class HelloWorld {

public static void main(String[] args) {

System.out.println(“Hello World”); // Display the string.

}

}

Save the code in a file with the name HelloWorld.java.[Not compulsory to save it with same name as that of class name]

Step 2. Compile the Source File into a .class File

Bring up a shell, or “command,” window. We can do this from the Start menu by choosing Command Prompt (Windows XP), or by choosing Run… and then entering cmd.

To compile the source file, change the current directory to the directory where the file is located. For example, if the source directory is java on the C drive, type the following command at the prompt and press Enter:

Goto your source code folder:

The command prompt should to D:\Core_Java_June_10>

If we enter dir at the prompt, you should see our source file.

Now we are ready to compile. At the prompt, type the following command and press Enter.

javac HelloWorld.java

The compiler has generated a bytecode file, HelloWorld.class. At the prompt, type dir to see the new file that was generated. Now that we have a .class file, you can run our program.

Step 3. Run the Program

In the same directory, enter the following command at the prompt:

java HelloWorld

A Closer Look at the “Hello World” Application

The “Hello World” application consists of three primary components: source code comments, the HelloWorld class definition, and the main method. The following explanation will provide us with a basic understanding of the code.

Source Code Comments

The following bold text defines the comments of the “Hello World!” application:

/**

* The HelloWorld class implements an application that

* simply prints “Hello World!” to standard output.

*/

class HelloWorld {

public static void main(String[] args) {

System.out.println (“Hello World”); // Display the string.

}

}

Comments are ignored by the compiler but are useful to other programmers. The Java programming language supports three kinds of comments:

/* text */

The compiler ignores everything from /* to */.

/** documentation */

This indicates a documentation comment (doc comment, for short). The compiler ignores this kind of comment, just like it ignores comments that use /* and */. The javadoc tool uses doc comments when preparing automatically generated documentation.

// text

The compiler ignores everything from // to the end of the line.

The HelloWorld Class Definition

The following bold text begins the class definition block for the “Hello World!” application:

class HelloWorld {

public static void main(String[] args) {

System.out.println (“Hello World”); // Display the string.

}

}

As shown above, the most basic form of a class definition is:

class Identifier {

. . .

}

The keyword class begins the class definition for a class named Identifier, and the code for each class appears between the opening and closing curly braces marked in bold above. Java being the object oriented programming language every code should and must be written in a class even main method must be defined in a class.

The main Method

The following bold text begins the definition of the main method:

class HelloWorld {

public static void main(String[] args) {

System.out.println (“Hello World”); //Display the string.

}

}

In the Java programming language, every application must contain a main method whose signature is:

public static void main(String[] args)

The modifiers public and static can be written in either order (public static or static public), but the convention is to use public static as shown above. We can name the argument anything we want, but most programmers choose “args” or “argv”.

The main method is the entry point for our application and will subsequently invoke all the other methods required by our program.

The main method accepts a single argument: an array of elements of type String.

public static void main(String[] args)

This array is the mechanism through which the runtime system passes information to our application. Each string in the array is called a command-line argument. Command-line arguments let users affect the operation of the application without recompiling it

The “Hello World!” application ignores its command-line arguments, but we should be aware of the fact that such arguments do exist.

Finally, the line:

System.out.println (“Hello World”);

uses the System class from the core library to print the “Hello World!” message to standard output.

System is a class present in java.lang package [Java Libraries are bundled in form of bundles called packages]. This class has one member called out which has functionality of printing.

Common Problems (and Their Solutions)

1. Compiler Problems

Common Error Messages on Microsoft Windows Systems

‘javac’ is not recognized as an internal or external command, operable program or batch file

If we receive this error, Windows cannot find the compiler (javac).

Here’s one way to tell Windows where to find javac. Suppose we installed the JDK in C:\Program Files\Java\jdk1.6.0_20. At the prompt we have to type the following command and press Enter:

C:\Program Files\Java\jdk1.6.0_20\bin\javac HelloWorld.java

If we choose this option, we will have to precede our javac and java commands with C:\Program Files\Java\jdk1.6.0_20\bin\ each time we compile or run a program.

Update the PATH variable will resolve the problem permanently

Set the PATH variable if we want to be able to conveniently run the JDK executables (javac.exe, java.exe, javadoc.exe, etc.) from any directory without having to type the full path of the command. If we don’t set the PATH variable, we need to specify the full path to the executable every time we run it, such as:

C:\Program Files\Java\jdk1.6.0_20\bin\javac MyClass.java

It’s useful to set the PATH permanently so it will persist after rebooting.

How do I set the PATH permanently? To set the PATH permanently, add the full path of the C:\Program Files\Java\jdk1.6.0_20\bin directory to the PATH variable. Typically this full path looks something like C:\Program Files\Java\jdk1.6.0_20\bin. Set the PATH as follows on Microsoft Windows:

a. Click Start > Control Panel > System on Windows XP or Start > Settings > Control Panel > System on Windows 2000.

b. Click Advanced > Environment Variables.

c. Add the location of bin folder of JDK installation for PATH in User Variables and System Variables. A typical value for PATH is:

C:\Program Files\Java\jdk1.6.0_20\bin

PATH environment variable is a series of directories separated by semi-colons (;) and is not case sensitive. Microsoft Windows looks for programs in the PATH directories in order, from left to right.

We should only have one bin directory for a JDK in the path at a time. Those following the first instance are ignored. If one is already present, update it to C:\Program Files\Java\jdk1.6.0_20\bin.

The new path takes effect in each new command window we open after setting the PATH variable.

2. Runtime Problems

1. Exception in thread “main” java.lang.NoClassDefFoundError: HelloWorld

If we receive this error, java cannot find our bytecode file, HelloWorld.class.

In such case we might have to change our CLASSPATH variable. To see if this is necessary, try clobbering the classpath with the following command.

set CLASSPATH=.

Now enter java HelloWorld again. If the program works now, we will have to change your CLASSPATH variable. The CLASSPATH variable is set in the same manner as that done for the PATH.

2. Exception in thread “main” java.lang.NoClassDefFoundError: HelloWorld/class

A common mistake made by beginner programmers is to try and run the java launcher on the .class file that was created by the compiler. For example, we will get this error if you try to run your program with java HelloWorld.class instead of java HelloWorld. Remember, the argument is the name of the class that you want to use, not the filename.

3. Exception in thread “main” java.lang.NoSuchMethodError: main

The Java VM requires that the class you execute with it have a main method at which to begin execution of your application. Check the signature of the main method.

JavaScript Mouse Events

Example to handle Images, Mouse events and“this” Keyoword: Example: Changing images :
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<title>Image Page</title>
<script type=”text/JavaScript”>
function changeImage() {
document.images[“img1”].src = “Desert.jpg”
}
function restoreImage() {
document.images[0].src = “Jellyfish.jpg”
}
</script>
</head>
<body>
<img src=”Jellyfish.jpg” alt=”Demo” name=”img1″ onmouseover=”changeImage()” onmouseout=”restoreImage()”
width=”100″ height=”100″ />
<img src=”Desert.jpg” alt=”Demo” onmouseover=”this.src=’Jellyfish.jpg'” onmouseout=”this.src=’Desert.jpg'”
width=”100″ height=”100″ />
</body>

Steps for Debugging JavaScript :
1. Browser ? Tools ? Internet Options… ? Advanced ? Uncheck – Disable Script Debugging (Internet Explorer) ? OK
2. Close the browser and start a new instance.
3. In JavaScript code, to start debugging write the statement: “debugger;”
4. Open the page the in browser
5. When the statement “debugger” is executed, browser shows a dialog for selecting the debugger…
6. Select the already exiting Visual Studio Instance –> OK
7. Continue Debugging using Debug toolbar (right click on menubar and select debug)

Example to show/hide a block using “Style” :

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<title>JS Demo</title>
<script type=”text/JavaScript”>
function r1_click() {
if (document.form1.r1[0].checked)
document.getElementById(“spn”).style[“display”] = “”;
else
document.getElementById(“spn”).style[“display”] = “none”;
}
function ShowHTMLOutput(ta) {
spn.innerHTML = ta.value
}
</script>
</head>
<body>
<form name=”form1″ action=””>
<input type=”radio” name=”r1″ value=”show” checked=”checked” onclick=”r1_click()” />Show
<input type=”radio” name=”r1″ value=”hide” onclick=”r1_click()” />Hide <span id=”spn”>
This is some text…</span>
<textarea name=”taDemo” rows=”5″ cols=”20″ onchange=”ShowHTMLOutput(this)”></textarea>
</form>
</body>
</html>