Monday, January 31, 2011

Lecture 5 & 6: Case Study and Metrics for Nonfunctional Requirements

Objective:
Highlight the importance of converting NFR into quantifiable form
Provide examples of Metrics which be used to quantify requirements or to derive customized metrics.

Goals and Nonfunctional Requirement
Non-functional requirements are sometimes written as general goals, which are difficult to verify. They should be expressed quantitatively using metrics (measures) that can be objectively tested

• Goal (unverifiable)
– The system should be easy to use by experienced controllers and should be organized in such a way that user errors are minimized

• Non-functional requirement (verifiable)
– Experienced controllers shall be able to use all the system functions after a total of two hours’ training. After this training, the average number of errors made by experienced users shall not exceed two per day

With the help of following metrics the NFRs can be verified quantitatively. It should also be noted that the cost of quantitatively verifying each NFR may be very high

It must also be kept in mind that there may be other metrics for various non functional requirements and the following list just provides you some examples so that you are able to understand that how various NFRs can be made quantifiable.

Metrics for Non-Functional Requirements
Before moving ahead it is important that we understand the difference between terms, measure, measurement and metrics
Measure refers to an individual value where as Measurement refers to the process of calculating the value i.e. Measure. Metrics relate measures so that some conclusion or decision is made. For example there are two measures, LOC(Line of Code) and Total errors. If we combine these two (Total Errors/Kilo Loc) then we may be able to judge the skills of development team.

Speed
• Processed transactions/second (For Transaction Oriented Systems, e.g. POS Systems)
• Response time (Can be used for systems that perform very lengthy and complex tasks. For example a software to recover contents of hard drive )
• Screen refresh time. (For games)

Ease of use
1. Training time
2. Number of help frames

Reliability
1. Mean time to failure (For non repairable systems)
2. Mean time between failure (For repairable systems)
3. Probability of unavailability
4. Rate of failure occurrence
5. Availability

Robustness
It is the capability of system to function correctly in unexpected or abnormal situations
1. Time to restart after failure
2. Percentage of events causing failure
3. Probability of data corruption on failure

Portability
1. Percentage of target-dependent statements
2. Number of target systems

Reference: Lecture # 3 By Dr. Ghulam Ahmed Farrukh, Virtual University Pakistan

Monday, January 24, 2011

Lecture # 4: Kinds of Nonfunctional Requirements

Objective:
This lecture identifies and elaborates the various kinds of Nonfunctional requirements

Nonfunctional Requirement
Following are the types of nonfunctional requirements.
• Product Requirement
o Usability Requirement
o Efficiency Requirement
 Performance Requirement
 Space Requirements
o Reliability Requirement
o Space Requirement
• Organizational Requirement
o Standard Requirement
o Implementation Requirement
o Delivery Requirement
• External Requirement
o Interoperability Requirement
o Ethical Requirement
o Legislative Requirement
 Privacy Requirement
 Space Requirement

Product Requirement:
Product requirements refer to the output of the entire project and project management initiative. This output is called product and product requirements refer to the quality attributes of this output. Product Requirements are further subcategorized into.
• Usability Requirement
These refer to the requirement related to user interface. For example,
“The user should have the facility to dial numbers either by selecting name from contact list or by speaking out the name”

• Efficiency Requirement
These are further divided into
o Performance Requirement
Such requirements refer to the speed of processing user requests, For example
The system should allow 100,000 hits per minute on the website
o Space Requirement
Such requirements refer to the space constraints. For example,
The version of application running on handheld device should not consume more than 1 MB of working memory.
The website will be hosted on an external server. The external server allocates 300 MB of space to each website

• Reliability Requirement
Reliability refers to probability that, a software will provide failure free operation in a fixed environment for a fixed interval of time. Example,
The system should not have a downtime of more than one second for continuous execution of 1000 hours.

• Portability Requirement
Portability refers to the capability of system to perform its functions on multiple platforms or environments. Following is an example of portability requirement
The system should run on both Microsoft and Linux platforms
The web site should be accessible from latest version of Internet Explorer, Chrome, Firefox and Opera.

Organizational Requirement:
There are certain requirements which are not related to the output or product, but are related to the processes and various options that are available to team during development. These options may be specific methodologies and standards that should be followed by the development team while developing the project, or technologies and techniques that can be used to develop and deliver project.
The term organization refers to both developer organization and client organization. Sometimes clients may ask the usage of specific technology for example, whereas sometimes the development team uses certain technology or standard, due to policy or expertise of developer organization
• Standard Requirement
These refer to any constraint to use certain standards. For example,
All development work subcontracted by the development organization shall be carried out in accordance with CMMI
• Implementation Requirements
These refer to the constraint related to implementation aspects which may be usage of specific technology (e.g. .NET), design pattern (e.g. MVC) or paradigm (e.g. O.O.P)
• Delivery Requirement
These refer to the constraint on how product will be delivered. For example,
On Completion, the website should be copied to local server using FTP.
The website and all dependencies should be provided in a DVD.

External Requirement:
Any other authority or stakeholder that is not part of development or client organization lies in the “external” category. In addition, the systems with which the product will interact also lie in the “external’ category. Requirements that come from such external entities are known as external requirement.
Interoperability Requirement:
Any information that identifies the systems with which the product should interact is an interoperability requirement. For example,
The system should send notifications which should be viewable by existing lotus notes applications.
The system should record task information and should also post it on Google calendar.
Ethical Requirement:
There are certain ethics that should be followed by developers and product which are referred to as ethical requirements
Legislative Requirement:
With the popularity and wide usage if IT, legislations have been made regarding usage/implementation of IT and regulatory bodies ensure that the law is followed properly. Any requirement to follow certain law comes in legislative requirement
Legislative requirement can be
• Privacy Requirement
There may be legislation about how securely data should be stored in the system. Specially in a banking sector such constraints are present and are specified by the central bank of the country.
• Safety Requirement
Software systems are now used in scenarios where safety is a major concern. Malfunctioning of software system will put lives of humans on risk. Therefore certain standards have been developed which ensure that the software is reliable enough to be used in such scenarios. Regulatory bodies may make it mandatory for software to follow a specific safety standard.

Sunday, January 23, 2011

Lecture # 3: Exercises to Clarify Concepts

Objectives:
• To further clarify the difference between non-functional and functional requirements using examples
• To develop, using examples, a sense to identify incompleteness of requirements.

Exercise 1:
Identify how the following requirements are incomplete

1. An email notification must be sent to user when he successfully registers into the system
2. The system will allow salesman to maintain their personal contact manager. When a contact is converted into client then other salesman having duplicate of these contacts in their personal contact manager are informed that they cannot do business with this contact.
3. The installer should check the prerequisites before starting itself.

The missing aspect in “1” is that it is not clear that what will be the contents of “email notification” sent to client

There are a number of missing aspects in “2”. It is not clear that how the other sales man will be informed that contact has been converted into business. Secondly, it is also not clear on what basis duplicates will be detected. (There may be more incomplete areas in “2”).

In “3”, the requirement engineer should inquire about the prerequisites that should be checked by installer.

Exercise 2:

Identify functional and nonfunctional requirements from the following

1. The system should have a very easy and intuitive view of customer transactions
• Functional Requirement: View of customer transactions
• Nonfunctional Requirement: Easy and intuitive

2. Authorized users should be able to modify customer’s personal information
• Functional Requirement: Modify Personal Info
• Nonfunctional Requirement: Authorization or Security

3. The system should calculate monthly summary of inventory and send email using mail server’s contact list.
• Functional Requirement: Calculate monthly inventory summary and send mail server’s contact list.
• Nonfunctional Requirement: Interoperability with email server such that contact list is accessed

4. The system should allow users to customize workflows. All system development should be done using scrum methodology
• Functional Requirement: Customize workflows
• Nonfunctional Requirement: All development will be based on scrum methodology.

Monday, January 17, 2011

Requirement Engineering: Lecture # 2

Objectives:
To develop skills to identify stakeholders of software
To learn various kinds of requirements
To have clear concepts of what functional requirement is?
To have clear concepts of what Nonfunctional requirements are?

Exercise: Identifying Stakeholders
It is really important that you get requirements from all stakeholders because the system may fail because a stakeholder is not satisfied or he had some important requirements with him, which did not get captured and thus not implemented. Following exercises are there to bring you in a habit of deep thinking to identify stakeholders.
• I want to take all quizzes using a software. Who will be the stakeholders in this scenario?
Answer:
Stakeholders may include at least the following
• Students
• Teachers
• Academics/Management
• Lab Administrator

• I want to develop a software for automating traffic signals on the road
Answer:
Stakeholders may include at least the following
• Police
• Drivers
• Pedestrians
Ambulance and other emergency transport including VIP squads

• I want to develop a software for automating the railway signals
Stakeholders may include at least the following
• Train staff/operators
• Car drivers

Lecture Contents:

Kinds of software requirements
• Functional Requirements
• Non Functional Requirements
• Domain Requirements
• Inverse Requirements
• Design and Implementation Constraints

Functional Requirement
These are statements that describe what the system does. In other words these are the statement of services the system should provide. They identify
• Reaction to particular input
• Behavior in particular situation
Sequencing and parallelism should also be captured by functional requirement as well as the abnormal behavior, which is documented in the form of exception handling.
E.g. The system should allow user to search for books, CDs and journals available in library
E.g. The system should record basic information regarding all the financial products as well as basic information about the provider and product related documents including brochures and forms
While documenting any kind of requirement, it must be ensured that complete requirement is being captured so the chances of misinterpretation or different interpretation is minimized
Customers and developers usually focus all their attention on functional requirements

Non-Functional Requirement:
These do not deal with the actions system do, but they rather they deal with the quality attributes of the system. They contribute to the emergent behavior of the system.
Non functional requirements are often neglected by the developers and requirement engineers. However they should be given due share specially due to two important reasons
Like some functional requirements, Non functional requirements are so important that there absence will effect acceptance of the product by client. For example,
• A Point of Sale terminal at super store should allow operators to quickly generate receipts for customers. If it takes long the management might discard it.
• A system like ZABDESK may be discarded by management simply because it not secure enough and someone can breach in to change the marks

It is important to know the Nonfunctional requirement at a very early stage because these requirements are built into the architecture of the system. Almost all functional requirements can be added after the delivery as well but most of the Nonfunctional requirements cannot be added later. For example, high performance can only be achieved if the architecture is aimed at it, it cannot be added later.

Tuesday, January 4, 2011

Requirements Engineering Lecture # 1: Introduction To Software Requirement Engineering

Learning objective
• To know what actually a requirement is?
Learning outcomes
• Detailed knowledge of what requirement is?
• Information of what is not considered part of requirement?
• What are the sources of requirement?
Overview
All softwares are made considering some requirements thus requirements form the foundation of the entire software process. Obviously, if the foundation of certain initiative is not correct then the entire initiative will end up as a failure
Why should we give importance to requirements?
As already mentioned, Requirements are the foundation of any software development initiative and if the requirements are incorrect the entire initiative will possibly lead to a failure.
To understand the importance further, let’s revisit a brief definition of a quality software

Quality software is one that meets the requirements of its end-users

No matter how innovative solution you give to user at lowest price and with promising service, the user will never be satisfied unless his/her requirement is not met

Let’s say, I ordered my tailor to stitch a suit that I can casually wear. I had limited budget and I could afford a single such suit at the moment. But my tailor within the same time frame and cost stitched a suit that was of supreme quality and design such that it was only suitable for very, very special occasions. In such scenario, I, as a customer will never be satisfied as my need did not get fulfilled and I no longer have any resources to acquire a dress that fulfills my need. Thus, the suit stitched by tailor, even after being the best of its kind, was least useful to me.
Therefore it is important that the requirement are correctly obtained and met so that the output satisfies the customer.
What is Engineering?
It is the practical application of scientific knowledge in the design, building and control of machines, roads, bridges etc.
To understand engineering further, lets read the definition of software engineering
The application of a systematic, disciplined, quantifiable approach to the development, operation and maintenance of software
When is engineering done?
Think for a moment, there are a lot of houses in villages or poor localities. Small bridges for pedestrians are also built in villages. But does their development require services of engineer who apply scientific knowledge or who follow systematic, disciplined or quantifiable approach?
The answer is obviously No.
It must be noticed that the above mentioned structures are there to fulfill very simple and primitive needs, however as the needs becomes complex the need of engineering i.e. application of scientific knowledge and adoption of systematic, disciplined and quantifiable approach arises.
Therefore, it must be remembered that as the needs become complex, the need for formal engineering increases.
Requirement Engineering:
When the scientific knowledge is applied or a systematic, disciplined and quantifiable approach to gathering, managing and documenting requirement is adopted, then it is known as requirement engineering
What is Requirement?

Definition 1: It is something wanted or needed.
Requirement Engineers must understand the difference between need and want. And they should have the required knowledge and skills to make customers understand what are their actual needs are

Definition 2: Complete description of what the system does rather than how
It is important to note that requirements must contain what i.e. the real objectives that must be achieved. The detailed design and procedures that must be followed to achieve the objectives are out of the scope of requirement engineers.
But it must be remembered that end users feel more comfortable in explain how rather than what.

Definition 3: It describes the complete specification of desired external behaviors of software system to be built
Complete specification means what system does from the perspective of different stakeholders
External behavior is the outputs that users get after giving certain inputs. It must be remembered that users judge the system based upon the external behavior.

Definition 4: A Condition or capability that must be met or processed by a system to satisfy a contract, standard, specification or other formally imposed document
Condition can also be considered as a constraint and capability is better known as functionality by many
Sources of Requirements
• Stakeholders (Entities that are interested in or are affected by the system)
• Documents
• Existing System
• Domain-Business Area

Lecture 2 & 3: Basic Windows Application using Visual Basic in Visual Studio

Note: Uploading screenshots is taking time... I will upload soon
Learning Objectives:
• To understand the basics of Visual Basic Language
• To develop simple windows based application through visual studio
Learning outcomes
• Understanding of multi-language support in .Net
• Understanding of syntax of visual basic
• Familiarity with the environment of Visual Studio
Multi-Language Support:
As mentioned in previous lecture that the compiler of every language in .NET generates the same MSIL code. This also leads to language independence, as any compiled code is in the common format thus understandable by compilers of other languages (within) as well.
In addition it must be recalled that the assembly executed by CLR also contains MSIL which implies that CLR is not concerned or aware of the actual language in which code was written and treats the compiled code of all languages in the same way
Integrated Development Environment:
An Integrated Development Environment (IDE) brings all of the programmers tool’s into one convenient place. There was a time when programmers had to edit files, save the files out, run the compiler, then the linker, build the application then run it through a debugger.
Today's IDEs bring editor, compiler, linker and debugger into one place along with project management tools to increase programmer productivity.
Visual Studio
Visual Studio is an IDE for building ASP.NET Web applications, XML Web Services, desktop applications, and mobile applications. Visual Basic, Visual C++, Visual C#, and Visual J# all use the same integrated development environment (IDE), which allows them to share tools and facilitates in the creation of mixed-language solutions

For creating new projects navigate to the menu and on clicking the New Project option following screen will be displayed from which you will have to select the project type and language. The figure 2.1 shows selection of “windows application” using Visual Basic language. After choosing the appropriate template i.e. “Windows Application” give a name to the project which will be store by default in Documents if Express edition of visual studio is used.


Fig 2.1

Once you create the application a screen similar to the following will be created.


Fig 2.2

As can be observed that the IDE consists of a number of menus and windows. Let’s see the purpose of each window that can be seen on the screen. On the top left is the solution explorer. Figure 2.4 focuses on solution explorer only.



Fig 2.3

Solution Explorer allows you to view items and perform item management tasks in a solution or a project. It also allows you to use the Visual Studio editors to work on files outside the context of a solution or project. A single solution and its projects appear in a hierarchical display of solution explorer that provides updated information about the status of your solution, projects, and items. This allows you to work on several projects at the same time. Because the selected project and item determines the toolbar icons, this list is a partial representation of those you might encounter while working in Solution Explorer.

(Icon Image will come here)Displays the appropriate property user interface for the selected item in the tree view.
(Icon Image)Shows all project items, including those that have been excluded and those that are normally hidden.
(Icon Image)Refreshes the state of the items in the selected project or solution.
(Icon Image)Launches Class Designer to display a diagram of the classes in the current project. (Icon Image)Opens the selected file for editing in the Code Editor.
(Icon Image)Opens the selected file for editing in the designer mode of the Code Editor.
(Icon Image)Adds a Solution Folder to the selected item. You can add a Solution Folder to the solution or to an existing Solution Folder.

Apart from solution explores you can also see a properties window and a toolbox shown in the figure that are following.

Fig 2.4


Fig 2.5

The details of the above mentioned windows will be discussed later.

In figure 2.2 you must have observed the following at the center. This is the designer of form.


Fig 2.6

Before continuing the discussion lets first see what is a Windows Form.

Windows Forms: are the base unit of your windows application. It is actually a blank slate that you, as a developer, enhance with controls to create a user interface and with code to manipulate data. Controls are actually graphical user interface components through which end-users communicate with your application. Visual Studio displays the set of controls that can be used by the programmer in toolbox (displayed on figure 2.4).
Recall the definition of software frameworks that they consist of collection of items and plug-in points where users can insert instructions/code. The controls are basically the items that programmers can use to quickly develop graphical user interface and you can also associate code/instructions with each control. These instructions get executed when the end-user interact with the user-interface. For example, you may want a message box to be displayed to the user when the user clicks a button (control) on the form

Developing the First Application:

Let’s create a simple application consisting of a button which when clicked will display a message box consisting of message “Hello World”. The learning outcome of this will be that you will learn how to add controls to form, associate code with the control and execute the code. In addition the objective is to also let you know about the structure of instruction and the basics of the grammar of C# technically known as syntax.
To develop the application, open a new project. (Read the beginning of notes for lecture # 2). The designer (refer to Fig 2.6) will be displayed at the center, on the left solution explorer (Fig 2.3) and properties window (Fig 2.5) will be displayed. On the right side toolbar will be displayed (Fig. 2.4). Click “Button” on toolbar and then click on the form being displayed on the designer. This will cause a new button to be created. Congratulations you have created your first object belonging to the category/class Button. As discussed that each class/category has certain characteristics (data/methods) that all the objects possess. If you want to see the data associated with the newly created button object. Right-click the button and click properties from the menu displayed. Observe that the properties window will become activated. The properties window consist of data associated with the object and the values stored in each data field. If you want to modify the data you can simply change the value.
Lets change the “Text” displayed on the new button object. For that go to the text property in the property window and type “Click Me”. (You can enter any message of your choice).
In order to associate code with the button, double click the button and you will go into the code view. The code view allows you to write instructions or in other words do the programming for the form. Type the following line at the location where cursor is blinking.

After writing this line, go to the debug menu and click start debugging. This will cause your application to execute.

Adding More Controls:

Let’s add another control which is known as TextBox. Again follow the same procedure i.e. click TextBox on the toolbox and click on the form. This will create a text box. The textbox also consists of a property known as Text. Whatever is written in the text property will be displayed in textbox.

The next task is to display the contents of the TextBox in the MessageBox when the button is clicked. As mentioned that text property stores the contents of the textbox, therefore in order to get the contents of the textbox, we will write the following instruction

In order to display the contents in the message box we will modify the above code as follows.


The above line states that the contents of textBox1.Text should be given to MsgBox which, as we have already seen, will display whatever that has been passed in brackets.
Label Control:
Currently the form does not contain any indication about what should be entered in the textbox. For such a purpose, Label control is used and the process of adding it is same. As in other controls studied so far “Text” property here is also used for indicating what should be displayed in the Label
String constant:
When you observe the above codes regarding message box you will identify that when displaying a predetermined set of characters (also known as String) in the message box, we used double quotes (“”). However when we wanted the contents of textbox which obviously depends upon the input of the user, we didn’t use the double quotes. Actually when any thing is written outside double quote it is considered to be something that the compiler/runtime should evaluate however things that are written in double quotes are considered as string constants
Variables:
Variables are place holders that can hold data values. For example age can be stored in a variable for further processing. Similarly Text property of TextBox is also a variable as it stores string values that are typed in the textbox.
The process of creating a variable is known as declaration. Following is an example of declaring and integer variable. The example also includes statement to store a value in the declared variable which is known as assignment. When the variable is assigned a value first time, it is known as initialization.


The above statements can be combined into a single one which is indicated as follows


Variables are also created in classes but when created in classes they are known as properties. For example Microsoft created a variable named Text in class Label which is termed as property of label.
Data Type:
As mentioned that while creating a variable you must mention a data type of that variable. Languages provide data types so that space is effectively utilized and the operations that can be performed are easily identified. The importance of data types is easily understood when it is taken into consideration that in real life the data that is stored has various types, for example salary or price may consist of a decimal point however, age and population do not. In addition to this if you consider age and population age will store a maximum value of probably 150 however population can store an exponentially large value. Therefore it won’t be effective if a language provides a single data type for both age and population. In such case the data type should be large enough to hold population, however when the same data-type will be assigned to age a lot space will be unnecessarily wasted. Therefore Microsoft has provided a range of data types in visual basic.