UGC NET STUDY MATERIALS

software project management quality assurance

August 2010
Master of Computer Application (MCA) – Semester 5
MC0084 – Software Project Management &
Quality Assurance – 4 Credits
(Book ID: B0958 & B0959)
Assignment Set – 1 (60 Marks)

Answer all Questions Each question carries FIFTEEN Marks

Book ID: B0958

1. Explain the following theoretical concepts in the context of Project Management:
A) Factors influencing project management
Project management is often summarized in a triangle. The three most important factors are time, cost and scope. These form the vertices with quality as a central theme.


1. Projects must be delivered on time.
2. Projects must be within cost.

3. Projects must be within scope.

4. Projects must meet customer quality requirements.

More recently, this has given way to a project management diamond, with time, cost, scope and quality, the four vertices and customer expectations as a central theme. No two customers' expectations are the same. So you must ask what their expectations are.

Project Manager
Project Manager is overall responsible for the successful planning and execution of a project. This title is used in the construction industry, architecture, information technology and many different occupations that are based on production of a product or service. The project manager has many tasks:
• Planning
• Staffing (acquiring human resource)
• Execution (putting the plan into action)
• Monitoring the progress of the project

After the above tasks, the project managers in an organization are responsible for more than managing individual projects. Their responsibility spans the overall organizations life cycle. Managers continuously monitor and assess the capabilities of the organization. For those, managers follow CMM (Capability Maturity Model) model. CMM can also be used to assess software organizations as part of software acquisition policy and to qualify contractors by requiring them to be certified according to CMM maturity levels.

The CMM (Capability Maturity Model) for software is a framework that was developed by the Software Engineering Institute (SEI) at Carnegie Mellon University by observing the best practices in software and other organizations. CMM reflects the collective process experience and expectations of many companies. One objective of the CMM is to distinguish mature processes from immature, or ad hoc, processes. Immature software processes imply that projects are executed without many guidelines, and the outcome of a project depends largely on the capability of the team and the project leader. On the other hand, with mature processes, a project is executed by following defined processes. In this case, the outcome of the project is less dependent on people and more on the processes. It follows, then, that the more mature the processes, the more predictable the results and the more well controlled the projects. Hence, the CMM framework describes the key elements of software processes at different levels of maturity. Consequently, it also specifies the path that a software process follows while moving from immature processes to highly mature processes.


Project Management activities:
Project Management is composed of several different types of activities such as:

1. Planning the work or objectives: A manager must decide what objectives are to be achieved, what resources are required to achieve
Software Project Management and Quality Assurance Unit 2 Sikkim Manipal University Page No. 19

the objectives, how and when the resources are to be acquired and how the objectives are achieved.

2. Assessing and controlling risk (or Risk Management): Risk is associated with several issues. It can be technical, methodology or financial one. Manager needs to plan from the starting of the project, to handle unexpected or sudden occurrence of risks.

3. Estimating resources: Resource estimation is another crucial task of the project manager. A resource can be software, hardware, human personnel, capital etc. Resource estimation involves the planning of required resources for the given tasks in the given period of time. Optimum utilization of these resources is the ultimate goal of the manager.

4. Allocation of resources and assigning tasks: This involves identification of task and allocation of required resources to fulfill the given task. For example, identification of skilled personnel to solve the given task.

5. Organizing the work: Organizing involves clear lines of authority and responsibility for groups of activities that achieve the goals of the enterprise.

6. Acquiring human resources (staffing): Staffing deals with hiring personnel, which involves recruiting, compensating, developing and promoting employees.

7. Directing activities: Directing involves leading subordinates. The goal of directing is to guide the subordinates and to understand and identify the organizational structure and goals of the enterprise.

8. Controlling project execution: Controlling consists of measuring and correcting activities to ensure that the goals are achieved. Controlling requires the measurement against plans and taking corrective action when development occurs.
9. Tracking and reporting progress: After assigning the tasks to the team members, it is essential to track and monitor the work progress. The work progress is documented at regular intervals.

10. Forecasting future trends in the project: The project must be designed to facilitate extensibility of new features in the forth coming days. This is very crucial task of manager or designer. Designers have to keep this point in mind, while designing architecture for the system.

11. Quality Management: Satisfying the customer requirements is called quality. Quality reflects in many ways. It can be through functionality, performance and external factors like portability etc. So the project manager needs to implement different quality management techniques from the analysis phase itself.

12. Issues solving: An issue can be a conflict among the team members, sudden increase in the attrition rate of employees, sudden drop in rupee value etc. Based on the issues, proper corrective action needs to be taken to ensure the smooth working of the system.

13. Defect prevention: A defect is a flaw in the system. It is more serious than an error. A defect occurs because of improper design, poor quality etc. A thorough testing is needed before and after implementation of the product, to avoid the defects.

14. Project Closure meet: Project closure describes the overall project details. The details can be conveyed through closure reports. Ex. Performance reports, testing reports and project completion reports.
Software Project Management and Quality Assurance Unit 2 Sikkim Manipal University Page No. 21

Controlling: Controlling consists of measuring and correcting activities to ensure that the goals are achieved. Controlling requires the measurement against plans and taking corrective action when development occurs.

Stakeholders Stakeholders are all those groups, units, individuals, or organizations, internal or external to our organization, which are impacted by, or can impact, the outcomes of the project. This includes the Project Team, Sponsors, Steering Committee, Customers, and Customer co-workers who will be affected by the change in customer work practices due to the new product or service.



B) Project Communication:


There are many reasons that software projects get into trouble. The scale of many development efforts is large, leading to complexity, confusion, and significant difficulties in coordinating team members. Uncertainty is common, resulting in a continuing stream of changes that ratchets the project team. Interoperability has become a key characteristic of many systems. New software must communicate with existing software and conform to predefined constraints imposed by the system or product.
To deal with them effectively, a software engineering team must establish effective methods for coordinating the people who do the work. To accomplish this, mechanisms for formal and informal communication among team members and between multiple teams must be established. Formal Software Project Management and Quality Assurance communication is accomplished through “writing”, structured meetings, and other relatively non-interactive and impersonal communication channels. Informal communication is more personal. Members of a software team share ideas on an ad hoc basis, ask for help as problems arise, and interact with one another on a daily basis.

Formal, impersonal approaches include software engineering documents and deliverables (including source code), technical memos, project milestones, schedules, and project control tools, change requests and related documentation, error tracking reports, and repository data.

Formal, interpersonal procedures focus on quality assurance activities applied to software engineering work products. These include status review meetings and design and code inspections.

Informal, interpersonal procedures include group meetings for information dissemination and problem solving and collocation of requirements and development staff.

Electronic communication encompasses electronic mail, electronic bulletin boards, and by extension, video based conferencing systems.

Interpersonal networking includes informal discussions with team members and those outside the project who may have experience or insight that can assist team members.

The following fig shows the parties involved during project work.



C) Statement of Work (SOW):


Large and complex systems require that detailed work requirements need to be written containing "what is to be done" in definitive and precise language and terminology. The purpose of a SOW is to detail the work requirements for projects and programs that have deliverables and/or services performed. There are five types of SOW (one for each phase of the acquisition life cycle) during the system life cycle as identified by the Systems Engineering Management Plan (SEMP). The SOW covers the work requirements and in conjunction with applicable performance/design requirements contained in specifications used for contractual agreements. Any proposed supplier can submit a proposal based on his perception of the needs as defined by the SOW, thus enabling a fair price for goods and/or services to be provided.

2. Explain the Software Cost estimation methods and the COCOMO model.


Software project management begins with a set of activities that are collectively called project planning. Before the project can begin, the manager and the software team must estimate the work to be done, the resources that will be required, and the time that will elapse from start to finish. Whenever estimates are made, we look into the future and accept some degree of uncertainty as a matter of course. To quote Frederick Brooks [BRO75], although estimating is as much art as it is science, this important activity need not be conducted in a haphazard manner. Useful techniques for time and effort estimation do exist. Process and project metrics can provide historical perspective and powerful input for the generation of quantitative estimates. Past experience (of all people involved) can aid immeasurably as estimates are developed and reviewed. Because estimation lays a foundation for all other project planning activities and project planning provides the road map for successful software engineering, we would be ill-advised to embark without it.
Steps for Estimation
Step 1: Establish Objectives
Key the estimating objectives to the needs for decision making information.

Balance the estimating accuracy objectives for the various system components of the cost estimates.

Re-examine estimating objectives as the process proceeds, and modify them where appropriate.

Step 2: Plans for Required Data and Resources
If we consider the software cost-estimation activity as a mini project, then we automatically cover this problem by generating a project plan at an early stage. The mini plan includes an early set of notes on the why, what, when, who, where, how, how much, and whereas of your estimating activity.

Step 3: Pin Down Software Requirements It is important to have a set of software specifications that are as unambiguous as possible (subject to qualifications with respect to our estimating objectives). A specification is testable to the extent that one can define a clear pass/fail test for determining whether or not the developed software will satisfy the specification. In order to be testable, specifications must be specific, unambiguous, and quantitative wherever possible.

Step 4: Work out as Much Detail as Feasible "As feasible" here means "as is consistent with our cost-estimating objectives". In general, the more detail to which we carry out our estimating activities, the more accurate our estimates will be, for three main reasons: a) the more detail we explore, the better we understand the technical aspects of the software to be developed; b) the more pieces of software we estimate, the more we get the law of large numbers working for us to reduce the variance of the estimate; c) the more we think through all the functions the software must perform, the less likely we are to miss the costs of some of the more unobtrusive components of the software.

Step 5: Use Several Independent Techniques and Sources None of the alternative techniques for software cost estimation is better than the others from all aspects, their strengths and weaknesses are complementary. It is important to use a combination of techniques, in order to avoid the weakness of any single method and to capitalize on their joint strengths.

Step 6: Compare and Iterate Estimates
The most valuable aspect of using several independent cost-estimation techniques is the opportunity to investigate why they give different estimates. An iteration of the estimates after finding why they give different estimates may converge to a more realistic estimate.

Step 7: Follow-up Once a software project is started, it is essential to gather data on its actual costs and progress and compare these to the estimates because :- Software estimating inputs are imperfect (sizing estimates, cost driver ratings). It is important to update the cost estimate with the new knowledge of the cost drivers by comparing the estimates to actual, providing a more realistic basis for some projects that do not exactly fit the estimating model. Both near-term project-management feedback and long-term model-improvement feedback of any estimates-versus-actual differences are important.

Software projects tend to be volatile: components are added, split up, rescoped, or combined in unforeseeable ways as the project progresses. The project manager needs to identify these changes and generate a more realistic update of the estimated upcoming costs. Software is an evolving field. Estimating techniques are all calibrated on previous projects, which may not have featured the future projects environment. It is important to sense differences due to these trends and incorporate them into improved project estimates and improved estimating techniques continuing to manage the project. Software estimating techniques are imperfect. For long-range improvements, we need to compare estimates to actual and use the results to improve the estimating techniques.

Software Cost Estimation Methods A number of methods have been used to estimate software costs.

Algorithimic Models
These methods provide one or more algorithms which produce a software cost estimate as a function of a number of variables which relate to some software metric (usually its size) and cost drivers.

Expert Judgement
This method involves consulting one or more experts, perhaps with the aid of an expert-consensus mechanism such as the Delphi technique

AnalogyEstimation
This method involves reasoning by analogy with one or more completed projects to relate their actual costs to an estimate of the cost of a similar new project.

Top-Down Estimation An overall cost estimate for the project is derived from global properties of the software product. The total cost is then split up among the various components.

Bottom-Up Estimation Each component of the software job is separately estimated, and the results aggregated to produce an estimate for the overall job.

Parkinson's Principle
A Parkinson principle ('Work expands to fill the available volume") is invoked to equate the cost estimate to the available resources.

Price to Win
The cost estimation developed by this method is equated to the price believed necessary to win the job. The estimated effort depends on the customer's budget and not on the software functionality.


Bottom-Up Estimation
Each component of the software job is separately estimated, and the results aggregated to produce an estimate for the overall job.





3. Describe various White Box testing techniques.
Definition:
"White box testing is a test case design method that uses the control structure of the procedural design to derive test cases".

The white box testing technique does the following,
1. Guarantee that all independent paths within a module have been exercised at least once.
2. Exercise all logical decisions on their true and false sides,
3. Execute all loops at their boundaries and within their operational bounds, and
4. Exercise internal data structures to ensure their validity
Basis Path Testing
This method enables the designer to derive a logical complexity measure of a procedural design and use it as a guide for defining a basis set of execution paths. Test cases that exercise the basis set are guaranteed to execute every statement in the program at least once during testing. A testing mechanism proposed by McCabe is to derive a logical complexity measure of a procedural design and use this as a guide for defining a basic set of execution paths. Test cases which exercise basic set will execute every statement at least once.

Basis path testing is a white-box testing technique first proposed by Tom McCabe. The basis path method enables the test case designer to derive a logical complexity measure of a procedural design and use this measure as a guide for defining a basis set of execution paths. Test cases derived to exercise the basis set are guaranteed to execute every statement in the program at least once during testing.

Flow Graph Notation
Flow Graphs
Flow graphs can be used to represent control flow in a program and can help in the derivation of the basis set. Each flow graph node represents one or more procedural statements. The edges between nodes represent flow of control. An edge must terminate at a node, even if the node does not represent any useful procedural statements. A region in a flow graph is an area bounded by edges and nodes. Each node that contains a condition is called a predicate node. Cyclomatic complexity is a metric that provides a quantitative measure of the logical complexity of a program. It defines the number of independent paths in the basis set and thus provides an upper bound for the number of tests that must be performed. Notation for representing control flow
Fig.
Sequence If While Until Case

Flow Graph Notations

On a flow graph:

• Arrows called edges represent flow of control

• Circles called nodes represent one or more actions.

• Areas bounded by edges and nodes are called regions.

• A predicate node is a node containing a condition

Any procedural design can be translated into a flow graph. Note that compound Boolean expressions at tests generate at least two predicate node and additional arcs.

Cyclomatic Complexity Cyclomatic complexity is a software metric that provides a quantitative measure of the logical complexity of a program. When used in the context of the basis path testing method, the value computed for cyclomatic complexity defines the number of independent paths in the basis set of a program and provides us with an upper bound for the number of tests that must be conducted to ensure that all statements have been executed at least once. An independent path is any path through the program that introduces at least one new set of processing statements or a new condition. When stated







Figure A flowchart notation




FIG B flow graph notation



Figure C predicate node

in terms of a flow graph, an independent path must move along at least one edge that has not been traversed before the path is defined. For example, a set of independent paths for the flow graph illustrated in Figure (B) is path 1: 1-11.
Path 2: 1-2-3-4-5-10-1-11 Path 3: 1-2-3-6-8-9-10-1-11 Path 4: 1-2-3-6-7-9-10-1-11 Note that each new path introduces a new edge. The path 1-2-3-4-5-10-1-2-3-6-8-9-10-1-11 is not considered to be an independent path because it is simply a combination of already specified paths and does not traverse any new edges. Paths 1, 2, 3, and 4 constitute a basis set for the flow graph in Figure (B). That is, if tests can be designed to force execution of these paths (a basis set), every statement in the program will have been guaranteed to be executed at least once and every condition will have been executed on its true and false sides. It should be noted that the basis set is not unique. In fact, a number of different basis sets can be derived for a given procedural design. How do we know how many paths to look for? The computation of cyclomatic complexity provides the answer. Cyclomatic complexity has a foundation in graph theory and provides us with extremely useful software metric. Complexity is computed in one of the three ways:
1. The number of regions of the flow graph corresponds to the cyclomatic complexity.

2. Cyclomatic complexity, V(G), for a flow graph, G, is defined as V(G) = E –N + 2. Where E is the number of flow graph edges, N is the number of flow graph nodes.

3. 3. Cyclomatic complexity, V(G), for a flow graph, G, is also defined as V(G) = P + 1. Where P is the number of predicate nodes contained in the flow graph G.

Referring once more to the flow graph in Figure (B), the cyclomatic complexity can be computed using each of the algorithms just noted:

1. The flow graph has four regions.
2. V (G) = 11 edges –9 nodes + 2 = 4.
3. V (G) = 3 predicate nodes + 1 = 4.

Therefore, the cyclomatic complexity of the flow graph in Figure (B) is 4.

Deriving Test Cases
The basis path testing method can be applied to a procedural design or to source code. In this section, we present basis path testing as a series of steps. The procedure Average, depicted in PDL will be used as an example (i.e. example1) to illustrate each step in the test case design method. Note that average, although an extremely simple algorithm contains compound conditions and loops. The following steps can be applied to derive the basis set:
Definition:

A test case is a series of tests used to determine whether one particular thing works properly. Often, that means trying the same operation over and over again with little in the procedure.

Steps for deriving the test cases
1. Using the design or code as a foundation, draw a corresponding flow Graph: Referring to the PDL for average program, the flow graph is created by numbering those PDL statements that will be mapped into corresponding flow graph nodes. The corresponding flow graph is in Figure 2.3
2. Determine the cyclomatic complexity of the resultant flow graph: The cyclomatic complexity for the fig 2.4 is calculated as follows, V (G) = 6 regions V (G) = 17 edges –13 nodes + 2 = 6 V (G) = 5 predicate nodes + 1 = 6


3. Determine a basis set of linearly independent paths: The value of V (G) provides the number of linearly independent paths through the program control Structure. In the case of procedure average, we expect to specify six Paths: Path 1: 1-2-10-11-13 Path 2: 1-2-10-12-13 Path 3: 1-2-3-10-11-13 Path 4: 1-2-3-4-5-8-9-2- . . . Path 5: 1-2-3-4-5-6-8-9-2- . . . Path 6: 1-2-3-4-5-6-7-8-9-2- . . . The ellipsis (. . .) following paths 4, 5, and 6 indicates that any path through the Remainder of the control structure is acceptable. It is often worthwhile to identify Predicate nodes as an aid in the derivation of test cases. In this case, nodes 2, 3, 5, 6, and 10 are predicate nodes. 4. Prepare test cases that will force execution of each path in the basis set: Data should be chosen so that conditions at the predicate nodes are appropriately set as each path is tested. Test cases that satisfy the basis set just described are Example 1: Sample Program code: PROCEDURE average; INTERFACE RETURNS average, total. Input, total.valid; INTERFACE ACCEPTS value, minimum, maximum; TYPE value [1:100] IS SCALAR ARRAY; TYPE average, total.input, total.valid; minimum, maximum, sum IS SCALAR; TYPE i IS INTEGER;
* This procedure computes the average of 100 or fewer * numbers that lie between bounding values; it also computes the sum and the total number valid. i = 1; total.input = total.valid = 0; sum = 0; DO WHILE value[i] <> –999 AND total.input < 100 ENDDO IF total.valid > 0 ENDIF END average increment total.input by 1; IF value[i] > = minimum AND value[i] < = maximum ENDIF increment i by 1; THEN average = sum / total.valid; ELSE average = –999; THEN increment total.valid by 1; sum = s sum + value[i] ELSE skip
Flow Graph notation

Path 1 test case: value(k) = valid input, where k < i for 2 ≤i ≤100 value(i) = – 999 where 2 ≤i ≤100 Expected results: Correct average based on k values and proper totals. Note: Path 1 cannot be tested stand-alone but must be tested as part of path 4, 5, and 6 tests. Path 2 test case value(1) = – 999 Expected results: Average = – 999; other totals at initial values.
Path 3 test case
Attempt to process 101 or more values.
First 100 values should be valid. Expected results: Same as test case 1. For the time being we have given 3 test cases only. Students are advised to write the remaining test cases.




Example has:

Cyclomatic Complexity of 4. Can be calculated as:

1. Number of regions of flow graph.

2. #Edges - #Nodes + #terminal vertices (usually 2)

3. #Predicate Nodes + 1

Independent Paths:

1. 1, 8

2. 1, 2, 3, 7b, 1, 8

3. 1, 2, 4, 5, 7a, 7b, 1, 8

4. 1, 2, 4, 6, 7a, 7b, 1, 8
Cyclomatic complexity provides upper bound for number of tests required to guarantee coverage of all program statements.
The Basis Set An independent path is any path through a program that introduces at least one new set of processing statements (must move along at least one new edge in the path). The basis set is not unique. Any number of different basis sets can be derived for a given procedural design. Cyclomatic complexity, V(G), for a flow graph G is equal to 1. The number of regions in the flow graph. 2. V(G) = E – N + 2 where E is the number of edges and N is the number of nodes. 3. V(G) = P + 1 where P is the number of predicate nodes. Prepare test cases that will force execution of each path in the basis set Create a set of tests that force the following situations:

Control Structure Testing
Control structure testing is a group of white-box testing methods.
Loop Testing:
Loops are fundamental to many algorithms and need thorough testing. There are four different classes of loops: simple, concatenated, nested, and unstructured.

Simple Loops, where n is the maximum number of allowable passes through the loop.

o Skip loop entirely
o Only one pass through loop
o Two passes through loop
o m passes through loop where m
o (n-1), n, and (n+1) passes through the loop.

Nested Loops

o Start with inner loop. Set all other loops to minimum values.
o Conduct simple loop testing on inner loop.
o Work outwards
o Continue until all loops are tested.

Concatenated Loops

o If independent loops, use simple loop testing.
o If dependent, treat as nested loops.

Unstructured loops

o Don't test – redesign.

Advantages of White box testing
i) As the knowledge of internal coding structure is prerequisite, it becomes very easy to find out which type of input/data can help in testing the application effectively.
ii) The other advantage of white box testing is that it helps in optimizing the code
iii) It helps in removing the extra lines of code, which can bring in hidden defects.

Disadvantages of white box testing:
i) As knowledge of code and internal structure is a prerequisite, a skilled tester is needed to carry out this type of testing, which increases the cost.
ii) And it is nearly impossible to look into every bit of code to find out hidden errors, which may create problems, resulting in failure of the application.

4. Describe the following with respect to integration testing:
A) Process Metrics
The only rational way to improve any process is to measure specific attributes of the process, develop a set of meaningful metrics based on these attributes, and then use the metrics to provide indicators that will lead to a strategy for improvement. But before we discuss software metrics and their impact on software process improvement, it is important to note that process is only one of a number of “controllable factors in improving software quality and organizational performance [PAU94].”
Referring to Figure process sits at the center of a triangle connecting three factors that have a profound influence on software quality and organizational performance.


The skill and motivation of people has been shown [BOE81] to be the single most influential factor in quality and performance. The complexity of the product can have a substantial impact on quality and team performance. The technology (i.e., the software engineering methods) that populates the process also has an impact.
In addition, the process triangle exists within a circle of environmental conditions that include the development environment (e.g., CASE tools), business conditions (e.g., deadlines, business rules), and customer characteristics (e.g., ease of communication). We measure the efficacy of a software process indirectly. That is, we derive a set of metrics based on the outcomes that can be derived from the process. Outcomes include measures of errors uncovered before release of the software, defects delivered to and reported by end-users, work products delivered (productivity), human effort expended, calendar time expended, schedule conformance and other measures.
We also derive process metrics by measuring the characteristics of specific software engineering tasks, for example, we might measure the effort and time spent Grady [GRA92] argues that there are “private and public” uses for different types of process data. Because it is natural that individual software engineers might be sensitive to the use of metrics collected on an individual basis, these data should be private to the individual and serve as an indicator for the individual only. Examples of private metrics include defect rates (by individual), defect rates (by module), and errors found during development. The “private process data” philosophy conforms well to the personal software process approach proposed by Humphrey [HUM95]. Humphrey describes the approach in the following manner: The Personal Software Process (PSP) is a structured set of process descriptions, measurements, and methods that can help engineers to improve their personal performance. It provides the forms, scripts and standards that help them estimate and plan their work. It shows them how to define processes and how to measure their quality and productivity. A fundamental PSP principle is that everyone is different and that a method that is effective for one engineer may not be suitable for another. The PSP thus helps engineers to measure and track their own work so they can find the methods that are best for them.
Humphrey recognizes that software process improvement can and should begin at the individual level. Private process data can serve as an important driver as the individual software engineer works to improve. Some process metrics are private to the software project team but public to all team members. Examples include defects reported for major software functions (that have been developed by a number of practitioners), errors found during formal technical reviews, and lines of code or function points per module and function. These data are reviewed by the team to uncover indicators that can improve team performance. Public metrics generally assimilate information that originally was private to individuals and teams. Project level defect rates (absolutely not attributed to an individual), effort, calendar times and related data are collected and evaluated in an attempt to uncover indicators that can improve organizational process performance. Software process metrics can provide significant benefit as an organization works to improve its overall level of process maturity. However, like all metrics, these can be misused, creating more problems than they solve. Grady [GRA92] suggests a software metrics etiquette that is appropriate for both managers and practitioners as they institute a process metrics program:

• Use common sense and organizational sensitivity when interpreting metrics data.

• Provide regular feedback to the individuals and teams who collect measures and metrics.

• Don’t use metrics to appraise individuals.

• Work with practitioners and teams to set clear goals and metrics that will be used to achieve them.

• Never use metrics to threaten individuals or teams.

• Metrics data that indicate a problem area should not be considered “negative.”

These data are merely an indicator for process improvement.

• Don’t obsess on a single metric to the exclusion of other important metrics. As an organization becomes more comfortable with the collection and use of process metrics, the derivation of simple indicators gives way to a more rigorous approach called statistical software process improvement (SSPI). In essence, SSPI uses software failure analysis to collect information about all errors and defects encountered as an application, system or product is developed and used. Failure analysis works in the following manner:
1. All errors and defects are categorized by origin (e.g., flaw in specification, flaw in logic, nonconformance to standards).
2. The cost to correct each error and defect is recorded.


3. The number of errors and defects in each category is counted and ranked in descending order. 4. The overall cost of errors and defects in each category is computed. 5. Resultant data are analyzed to uncover the categories that result in highest cost to the organization. 6. Plans are developed to modify the process with the intent of eliminating (or reducing the frequency of) the class of errors and defects that is most costly.
Following steps 1 and 2, a simple defect distribution can be developed (Figure ). [GRA94]. For the pie-chart noted in the figure, eight causes of

defects and their origin (indicated by shading) are shown. Grady suggests the development of a fishbone diagram [GRA92] to help in diagnosing the data represented in the frequency diagram. Referring to Figure the spine of the diagram (the central line) represents the quality factor under consideration (in this case specification defects that account for 25 percent of the total). Each of the ribs (diagonal lines) connecting to the spine indicate potential causes for the quality problem (e.g., missing requirements, ambiguous specification, incorrect requirements, changed requirements). The spine and ribs notation is then added to each of the major ribs of the diagram to expand upon the cause noted. Expansion is shown only for the incorrect cause in Figure


The collection of process metrics is the driver for the creation of the fishbone diagram. A completed fishbone diagram can be analyzed to derive indicators that will enable a software organization to modify its process to reduce the frequency of errors and defects.

B) Project Metrics
Software process metrics are used for strategic purposes. Software project measures are tactical. That is, project metrics and the indicators derived from them are used by a project manager and a software team to adapt project work flow and technical activities. The first application of project metrics on most software projects occurs during estimation. Metrics collected from past projects are used as a basis from which effort and time estimates are made for current software work. As a project proceeds, measures of effort and calendar time expended are compared to original estimates (and the project schedule). The project manager uses these data to monitor and control progress. As technical work commences, other project metrics begin to have significance. Production rates represented in terms of pages of documentation, review hours, function points, and delivered source lines are measured. In addition, errors uncovered during each software engineering task are tracked. As the software evolves from specification into design, technical metrics are collected to assess design quality and to provide indicators that will influence the approach taken to code generation and testing. The intent of project metrics is twofold. First, these metrics are used to minimize the development schedule by making the adjustments necessary to avoid delays and mitigate potential problems and risks. Second, project metrics are used to assess product quality on an ongoing basis and, when necessary, modify the technical approach to improve quality. As quality improves, defects are minimized, and as the defect count goes down, the amount of rework required during the project is also reduced. This leads to a reduction in overall project cost.

Inputs – measures of the resources (e.g., people, environment) required to do the work.

Outputs – measures of the deliverables or work products created during the software engineering process.

Results – measures that indicate the effectiveness of the deliverables.

In actuality, this model can be applied to both process and project. In the project context, the model can be applied recursively as each framework activity occurs. Therefore the output from one activity becomes input to the next. Results of metrics can be used to provide an indication of the usefulness of work products as they flow from one frame work activity to the next.

C) Software Measurement
Measurements can be either direct or indirect. Direct measures are taken from a feature of an item (e.g. length). Indirect measures associate a measure to a feature of the object being measured (e.g. quality is based upon counting rejects). Direct measures in a product include lines of code (LOC), execution speed, memory size, and defects reported. Indirect measures include functionality, quality, complexity, efficiency, reliability, and maintainability. Direct measures are generally easier to collect than indirect measures. Size-oriented metrics are used to collect direct measures of software engineering output and quality. Function-oriented metrics provide indirect measures.
Size-Oriented Metrics
Size-oriented metrics are a direct measure of software and the process by which it was developed. These metrics can include effort (time), money spent, KLOC (1000s of lines of code), pages of documentation created, errors, and people on the project. From this data some simple size-oriented metrics can be generated. Productivity = KLOC / person-month Quality = defects / KLOC Cost = Cost / KLOC Documentation = pages of documentation / LOC Size-oriented metrics are not universally accepted. The use of LOC as a key measure is the center of the conflict. Proponents of the LOC measure claim:

It is an artifact of all software engineering processes which can easily be counted

Many existing metrics exist which use LOC as an input

A large body of literature and data exist which is predicated on LOC

Opponents of the LOC measure claim:

That it is language dependent

Well designed short programs are penalized

They do not work well with non-procedural languages

Their use in planning is difficult because the planner must estimate LOC before the design is completed

Function-Oriented Metrics
Function-oriented metrics are indirect measures of software which focus on functionality and utility. The first function-oriented metrics was proposed by Albrecht who suggested a productivity measurement approach called the function point method. Function points (FPs) are derived from countable measures and assessments of software complexity.

Five characteristics are used to calculate function points. These values are number of user inputs, number of user outputs, number of user inquiries, (on-line inputs), number of files, number of external interfaces (machine readable interfaces - tape, disk). Once the five information domain characteristics have been determined, they are weighted using the following table,


The weighted values are summed and function points are calculated using, FP = count-total * (0.65 + 0.01 * SUM(Fi)) where Fi are complexity adjustment values.
Once calculated, FPs may be used in place of LOC as a measure of productivity, quality, cost, documentation, and other attributes. Function points were originally designed to be applied to business information systems. Extensions have been suggested called feature points which may enable this measure to be applied to other software engineering applications. Feature points accommodate applications in which the algorithmic complexity is high such as real-time, process control and embedded software applications. Feature points are calculated as were function points with the additions of an additional software characteristic, algorithm. An algorithm is a bounded computational problem such as inverting a matrix, decoding a bit string or handling an interrupt. Feature points are calculated using:


The sum of these values is used in the function point calculation to calculate the feature points.

Metric Comparisons
The relationship between LOC and FP depend on the programming language being used. Rough estimates for the number of lines of code needed for one function point reveal the following.















August 2010
Master of Computer Application (MCA) – Semester 5
MC0084 – Software Project Management &
Quality Assurance – 4 Credits
(Book ID: B0958 & B0959)
Assignment Set – 2 (60 Marks)

Answer all Questions Each question carries FIFTEEN Marks

Book ID: B0958
1. Describe the following concepts with the help of relevant examples:
A) Effective Risk Management B) Risk Categories
C) Aids for Risk Identification

2. Describe the following with respect to Team Development and Conflict Management:
A) Centralized-Control Team Organization
B) Decentralized-Control Team Organization
C) Mixed-Control Team Organization


Book ID: B0959
3. Explain the following Functional Specifications with suitable examples:
A) Black-Box Specification B) State-Box Specification
C) Clear-Box Specification

4. Explain various Software quality standards.

MC0083 – Object Oriented Analysis & Design using UML

August 2010
Master of Computer Application (MCA) – Semester 5
MC0083 – Object Oriented Analysis &
Design using UML– 4 Credits
(Book ID: B0969)
Assignment Set – 1 (60 Marks)

Answer all Questions Each question carries TEN Marks

1. Describe the theory behind Object oriented systems development methodology.
Object oriented systems development methodology
In an object-oriented environment, software is a collection of discrete objects that encapsulate their data as well as the functionality to model real world “objects”. In an object oriented system, everything is an object and each object is responsible for itself. In a payroll application, instead of saying, “System, compute the payroll of this employee”, you tell the employee object, “Compute your payroll”.

Advantages of Object Orientation
Object oriented systems are easier to adapt to changing requirements, easier to maintain, more robust, and promote greater design and code reuse.

1. Higher level of abstraction: Top-down approach supports abstraction at the function level. The object-oriented approach supports abstraction at the object level. Since objects encapsulate both data (attributes) and functions (methods), they work at a higher level of abstraction.

2. Seamless transition among different phases of software development: The object-oriented approach essentially uses the same language to talk about analysis, design, programming and database design. This seamless approach reduces the level of complexity and redundancy and makes for clearer, more robust system development.

3. Encouragement of good programming techniques: In a properly designed system, the classes will be grouped into subsystems but remain independent; therefore, changing one class has no impact on other classes, and so, the impact is minimized which encourages good programming.

4. Promotion of reusability: Objects are reusable because they are modeled directly out of real-world problem domain. The object orientation adds inheritance, which is a powerful technique that allows classes to be built from each other and therefore, only differences and enhancements between the classes need to be designed and coded.


2. Describe the following with suitable examples:

A) Object and Identity :A special feature of object-oriented systems is that every object has its own unique and immutable identity. An object’s identity comes into being when the object is created and continues to represent that object from then on. This identity never is confused with another object, even if the original object has been deleted. The identity name never changes even if all the properties of the object change – it is independent of the object’s state. In particular, the identity does not depend on the object’s name, or its key, or its location.

B) Static and dynamic binding:

The process of determining (dynamically) at run time which functions to invoke is termed as dynamic binding. Making this determination earlier, at compile time, is called static binding. Static binding optimizes the calls. Dynamic binding occurs when polymorphic calls are issued.

C) Object persistence:

An object can persist beyond application session boundaries, during which the object is stored in a file or a database, in some file or database form. The object can be retrieved in another application session and will have the same state and relationship to other objects as at the time it was saved. The lifetime of an object can be explicitly terminated. After an object is deleted, its state is inaccessible and its persistent storage is reclaimed. Its identity, however, is never reused.

D) Meta classes:
In object-oriented system everything is an object including a class. Class belongs to a class called meta-class, or class of classes. Classes are instances of a meta-class. The meta-class is a class and therefore an instance of itself. Meta-classes are used by the compiler. Meta-classes handle messages to classes, such as constructors, “new”, and “class variables”.



3. Describe the following with suitable real time examples:

A) The software development process:
System development can be viewed as a process. Furthermore, the development itself, in essence, is a process of change, refinement, transformation, or addition to existing product. The process can be divided into small, interacting phases – subprocesses. Each subprocess must have the following:

1. A description in terms of how it works


2. Specification of the input required for the process


3. Specification of the output to be produced

Generally, the software development process can be viewed as a series of transformations, where the output of one transformation becomes the input of the subsequent transformation

1. Transformation 1 (analysis) – translates the users’ needs into system requirements and responsibilities.

2. Transformation 2 (design) – begins with a problem statement and ends with a detailed design that can be transformed into an operational system.

3. Transformation 3 (implementation) – refines the detailed design into the system deployment that will satisfy users’ needs.

An example of the software development process is the waterfall approach, which starts with deciding what is to be done. Once the requirements have been determined, we next must decide how to accomplish them. This is followed by a step in which we do it, whatever “it” has required us to do. We then must test the result to see if we have satisfied the users’ requirements. Finally, we use what we have done.
In the real world, the problems are not always well-defined and that is why the waterfall model has limited utility.




B) Building high-quality software:

To achieve high quality in software we should be able to answer the following questions:

1. How do we determine that the system is ready for delivery?


2. Is it now an operational system that satisfies users’ needs?


3. Is it correct and operating as we thought it should?


4. Does it pass an evaluation process?

Blum describes a means of system evaluation in terms of four quality measures:

1. Correspondence – measures how well the delivered system matches the needs of the operational environment, as described in the original requirements statement.

2. Validation – task of predicting correspondence.

3. Correctness – measures the consistency of the product requirements with respect to the design specification.

4. Verification – exercise of determining correctness.

Verification: Am I building the product right?
Validation: Am I building the right product?

5. Validation begins as soon as the project starts, but verification can begin only after a specification has been accepted.



4. Describe the following Object Oriented Methodologies:

A) Patterns: 

Pattern identifies the key aspects of a common design structure that make it useful for creating a reusable object-oriented design. It identifies the participating classes and instances, their roles and collaborations, and the distribution of responsibilities. It describes when it applies, whether it can be applied in view of other design constraints, and the consequences and trade-offs of its use.
A pattern is [an] instructive information that captures the essential structure and insight of a successful family of proven solutions to a recurring problem that arises within a certain context and system of forces.
A pattern involves a general description of a solution to a recurring problem bundle with various goals and constraints. But a pattern does more than just identify a solution; it also explains why the solution is needed. However, not every solution, algorithm, best practice, maxim, or heuristic constitutes a pattern (one or more key pattern ingredients may be absent). Even if something appears to have all the requisite pattern components, it should not be considered as a pattern until it has been verified to be a recurring phenomenon (preferably found in at least three existing systems; this often is called the rule of three). A “pattern in waiting”, which is not yet known to recur, sometimes is called a proto-pattern.
Coplien explains that a good pattern will do the following:


1. It solves a problem. Patterns capture solutions, not just abstract principles or strategies.


2. It is a proven concept. Patterns capture solutions with a track record, not theories or speculation.


3. The solution is not obvious. The best patterns generate a solution to a problem indirectly – a necessary approach for the most difficult problems of design.


4. It describes a relationship. Patterns do not just describe modules, but describe deeper system structures and mechanisms.


5. The pattern has a significant human component. All software serves human comfort or quality of life; the best patterns explicitly appeal to aesthetics and utility.

Generative and Non-generative Patterns:

Generative patterns are patterns that not only describe a recurring problem; they can tell us how to generate something and can be observed in the resulting system architectures. Generative patterns are dynamic.
Non-generative patterns are static and passive: They describe recurring phenomena without necessarily saying how to reproduce them.
The successive application of several patterns, each encapsulating its own problem and forces, unfolds a larger solution, which emerges indirectly as a result of the smaller solutions. It is the generation of such emergent behavior that appears to be what is meant by generativity.


B) Frameworks :
A framework is a way of presenting a generic solution to a problem that can be applied to all levels in a development.
A framework is a set of cooperating classes that make up a reusable design for a specific class of software. A framework provides architectural guidance by partitioning the design into abstract classes and defining their responsibilities and collaborations. A developer customizes a framework to a particular application by sub-classing and composing instances of framework classes. The framework captures the design decisions that are common to its application domain. Frameworks thus emphasize design reuse over code reuse, though a framework usually includes concrete subclasses which you can put to work immediately.
A framework is executable software, whereas design patterns represent knowledge and experience about software.
Gamma et al. describe the major differences between design patterns and frameworks as follows:

1. Design patterns are more abstract than frameworks. Frameworks can be embodied in code, but only examples of patterns can be embodied in code.


2. Design patterns are smaller architectural elements than frameworks. A typical framework contains several design patterns but the reverse is never true.


3. Design patterns are less specialized than frameworks.


5. Describe the goals and scope of UML with suitable examples.

The primary design goals of the UML are as follows:
1. Provide users with a ready-to-use, expressive visual modeling language to develop and exchange meaningful models.
2. Furnish extensibility and specialization mechanisms to extend the core concepts.
3. Support specifications that are independent of particular programming languages and development processes.
4. Provide a formal basis for understanding the modeling language.
5. Encourage the growth of the object tools market.
6. Support higher-level development concepts such as components, collaborations, frameworks and patterns.
7. Integrate best practices.

These goals are discussed in detail below.
Provide users with a ready-to-use, expressive visual modeling language to develop and exchange meaningful models
It is important that the Object Analysis and Design (OA&D) standard support a modeling language that can be used ―out of the box‖ to do normal general-purpose modeling tasks. If the standard merely provides a meta-meta-description that requires tailoring to a particular set of modeling concepts, then it will not achieve the purpose of allowing users to exchange models without losing information or without imposing excessive work to map their models to a very abstract form. The UML consolidates a set of core modeling concepts that are generally accepted across many current methods and modeling tools. These concepts are needed in many or most large applications, although not every concept is needed in every part of every application. Specifying a meta-meta-level format for the concepts is not sufficient for model users, because the concepts must be made concrete for real modeling to occur. If the concepts in different application areas were substantially different, then such an approach might work, but the core concepts needed by most application areas are similar and should be supported directly by the standard without the need for another layer.
Furnish extensibility and specialization mechanisms to extend the core concepts
OMG expects that the UML will be tailored as new needs are discovered and for specific domains. At the same time, we do not want to force the common core concepts to be redefined or re-implemented for each tailored area. Therefore, we believe that the extension mechanisms should support deviations from the common case, rather than being required to implement the core modeling concepts themselves. The core concepts should not be changed more than necessary. Users need to be able to :
• build models using core concepts without using extension mechanisms for most normal applications,
• add new concepts and notations for issues not covered by the core,
• choose among variant interpretations of existing concepts, when there is no clear consensus,
• specialize the concepts, notations, and constraints for particular application domains.

Support specifications that are independent of particular programming languages and development processes
The UML must and can support all reasonable programming languages. It must also and can support various methods and processes of building models. The UML can support multiple programming languages and development methods without excessive difficulty.
Provide a formal basis for understanding the modeling language
Because users will use formality to help to understand the language, it must be both precise and approachable; a lack of either dimension damages its usefulness. The formalisms must not require excessive levels of indirection or layering, use of low level mathematical notations distant from the modeling domain, such as set-theoretic notation, or operational definitions that are equivalent to programming an implementation. The UML provides a formal definition of the static format of the model using a meta model expressed in UML class diagrams. This is a popular and widely accepted formal approach for specifying the format of a model and directly leads to the implementation of interchange formats. UML expresses well-formed constraints in precise natural language plus Object Constraint Language expressions. UML expresses the operational meaning of most constructs in precise natural language. The fully formal approach taken to specify languages such as Algol-68 was not approachable enough for most practical usage.
Encourage the growth of the object tools market
By enabling vendors to support a standard modeling language used by most users and tools, the industry benefits. While vendors still can add value in their tool implementations, enabling interoperability is essential. Interoperability requires that models can be exchanged among users and tools without loss of information. This can only occur if the tools agree on the format and meaning of all the relevant concepts. Using a higher meta-level is no solution unless the mapping to the user-level concepts is included in the standard.
Support higher-level development concepts such as components, collaborations, frameworks, and patterns
Clearly defined semantics of these concepts is essential to reap the full benefit of object-orientation and reuse. Defining these within the holistic context of a modeling language is a unique contribution of the UML.

Integrate best practices 

A key motivation behind the development of the UML has been to integrate the best practices in the industry, encompassing widely varying views based on levels of abstraction, domains, architectures, life cycle stages, implementation technologies, etc. The UML is indeed such an integration of best practices.

Scope of the UML:

The Unified Modeling Language (UML) is a language for specifying, constructing, visualizing, and documenting the artifacts of a software-intensive system.
First and foremost, the Unified Modeling Language fuses the concepts of Booch, OMT, and OOSE. The result is a single, common, and widely usable modeling language for users of these and other methods.
Secondly, the Unified Modeling Language pushes the envelope of what can be done with existing methods. As an example, the UML authors targeted the modeling of concurrent, distributed systems to assure the UML adequately addresses these domains.
Thirdly, the Unified Modeling Language focuses on a standard modeling language, not a standard process. Although the UML must be applied in the context of a process, it is our experience that different organizations and problem domains require different processes. (For example, the development process for shrink-wrapped software is an interesting one, but building shrink-wrapped software is vastly different from building hard-real-time avionics systems upon which lives depend.) Therefore, the efforts concentrated first on a common metamodel (which unifies semantics) and second on a common notation (which provides a human rendering of these semantics). The UML authors promote a development process that is use-case driven, architecture centric, and iterative and incremental.
The UML specifies a modeling language that incorporates the object-oriented community’s consensus on core modeling concepts. It allows deviations to be expressed in terms of its extension mechanisms. The Unified Modeling Language provides the following:


1. Semantics and notation to address a wide variety of contemporary modeling issues in a direct and economical fashion.


2. Semantics to address certain expected future modeling issues, specifically related to component technology, distributed computing, frameworks, and executability.


3. Extensibility mechanisms so individual projects can extend the metamodel for their application at low cost. We don’t want users to directly change the UML metamodel.


4. Extensibility mechanisms so that future modeling approaches could be grown on top of the UML.


5. Semantics to facilitate model interchange among a variety of tools.


6. Semantics to specify the interface to repositories for the sharing and storage of model artifacts.



6. Explain the following with respect to UML Architecture:

A) Four-Layer Meta model Architecture The UML meta model is defined as one of the layers of a four-layer meta modeling architecture. This architecture is a proven infrastructure for defining the precise semantics required by complex models. There are several other advantages associated with this approach. They are as follows:

1. It refines semantic constructs by recursively applying them to successive meta layers.


2. It provides an architectural basis for defining future UML meta model extensions.


3. It furnishes an architectural basis for aligning the UML meta model with other standards based on a four-layer meta modeling architecture, in particular the OMG Meta-Object Facility (MOF).

The generally accepted framework for meta modeling is based on an architecture with four layers namely:


1. meta-meta model


2. meta model


3. model


4. user objects


The meta-meta modeling layer forms the foundation for the meta modeling architecture. The primary responsibility of this layer is to define the language for specifying a meta model. A meta-meta model defines a model at a higher level of abstraction than a meta model, and is typically more compact than the meta model that it describes. A meta-meta model can define multiple meta models, and there can be multiple meta-metamodels associated with each meta model.
While it is generally desirable that related metamodels and meta-metamodels share common design philosophies and constructs, this is not a strict rule. Each layer needs to maintain its own design integrity. Examples of meta-metaobjects in the meta-metamodeling layer are: MetaClass, MetaAttribute, and MetaOperation.
A metamodel is an instance of a meta-metamodel. The primary responsibility of the metamodel layer is to define a language for specifying models. Metamodels are typically more elaborate than the meta-metamodels that describe them, especially when they define dynamic semantics. Examples of metaobjects in the metamodeling layer are: Class, Attribute, Operation, and Component.
A model is an instance of a metamodel. The primary responsibility of the model layer is to define a language that describes an information domain. Examples of objects in the modeling layer are, StockShare, askPrice, sellLimitOrder, and StockQuoteServer.
User objects (a.k.a. user data) are an instance of a model. The primary responsibility of the user objects layer is to describe a specific information domain. Examples of objects in the user objects layer are: , 654.56, sell_limit_order, and .

B) Package Structure:

 
The complexity of the UML metamodel is managed by organizing it into logical packages. These packages group metaclasses that show strong cohesion with each other and loose coupling with metaclasses in other packages.

The Foundation and Behavioral Elements packages are further decomposed as :

  • Foundation Packages
  • Behavioral Elements Packages

C) Levels of Formalism :
A common technique for specification of languages is to first define the syntax of the language and then to describe its static and dynamic semantics. The syntax defines what constructs exist in the language and how the constructs are built up in terms of other constructs. Sometimes, especially if the language has a graphic syntax, it is important to define the syntax in a notation independent way, that is, to define the abstract syntax of the language. The concrete syntax is then defined by mapping the notation onto the abstract syntax. The static semantics of a language define how an instance of a construct should be connected to other instances to be meaningful, and the dynamic semantics define the meaning of a well-formed construct. The meaning of a description written in the language is defined only if the description is well formed, that is, if it fulfills the rules defined in the static semantics.
The specification uses a combination of languages – a subset of UML, an object constraint language, and precise natural language to describe the abstract syntax and semantics of the full UML.
In constructing the UML metamodel different techniques have been used to specify language constructs, using some of the capabilities of UML. The main language constructs are reified into metaclasses in the metamodel. Other constructs, in essence being variants of other ones, are defined as stereotypes of metaclasses in the metamodel. This mechanism allows the semantics of the variant construct to be significantly different from the base metaclass. Another more “lightweight” way of defining variants is to use metaattributes. As an example, the aggregation construct is specified by an attribute of the metaclass AssociationEnd, which is used to indicate if an association is an ordinary aggregate, a composite aggregate, or a common association.

D) Naming Conventions and Typography

In the description of UML, the following conventions have been used:

1. When referring to constructs in UML, not their representation in the metamodel, normal text is used.

2. Metaclass names that consist of appended nouns/adjectives, initial embedded capitals are used (for example, „ModelElement,‟ „StructuralFeature‟).

3. Names of metaassociations/association classes are written in the same manner as metaclasses (for example, „ElementReference‟).

4. Initial embedded capital is used for names that consist of appended nouns/adjectives (for example, „ownedElement,‟ „allContents‟).

5. Boolean metaattribute names always start with „is‟ (for example, „isAbstract‟).

6. Enumeration types always end with “Kind” (for example, „AggregationKind‟).

7. While referring to metaclasses, metaassociations, metaattributes, etc. in the text, the exact names as they appear in the model are always used.

8. Names of stereotypes are delimited by guillemets and begin with lowercase (for example, «type»).



Dot net technology (.NET)

August 2010
Master of Computer Application (MCA) – Semester 5
MC0081 – .(DOT) Net Technologies – 4 Credits
(Book ID: B0974)
Assignment Set – 1 (40 Marks)

Answer all Questions Each question carries TEN marks
1. Explain the following with respect to Dot Net Technology:
A) Features of .Net platform
The .NET Framework is an integral Windows component that supports building and running the next generation of applications and XML Web services. The .NET Framework is designed to fulfill the following objectives:

To provide a consistent object-oriented programming environment whether object code is stored and executed locally, executed locally but Internet-distributed, or executed remotely.

To provide a code-execution environment that minimizes software deployment and versioning conflicts.

To provide a code-execution environment that promotes safe execution of code, including code created by an unknown or semi-trusted third party.

To provide a code-execution environment that eliminates the performance problems of scripted or interpreted environments.

To make the developer experience consistency across widely varying types of applications, such as Windows-based applications and Web-based applications.

To build all communication on industry standards to ensure that code based on the .NET Framework can integrate with any other code.
The .NET Framework has two main components: the common language runtime and the .NET Framework class library. The common language runtime is the foundation of the .NET Framework. You can think of the runtime as an agent that manages code at execution time, providing core services such as memory management, thread management, and remoting, while also enforcing strict type safety and other forms of code accuracy that promote security and robustness. In fact, the concept of code management is a fundamental principle of the runtime. Code that targets the runtime is known as managed code, while code that does not target the runtime is known as unmanaged code. The class library, the other main component of the .NET Framework, is a comprehensive, object-oriented collection of reusable types that you can use to develop applications ranging from traditional command-line or graphical user interface (GUI) applications to applications based on the latest innovations provided by ASP.NET, such as Web Forms and XML Web services. The .NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the execution of managed code, thereby creating a software environment that can exploit both managed and unmanaged features. The .NET Framework not only provides several runtime hosts, but also supports the development of third-party runtime hosts. For example, ASP.NET hosts the runtime to provide a scalable, server-side environment for managed code. ASP.NET works directly with the runtime to enable ASP.NET applications and XML Web services, both of which are discussed later in this topic.
Internet Explorer is an example of an unmanaged application that hosts the runtime (in the form of a MIME type extension). Using Internet Explorer to host the runtime enables you to embed managed components or Windows Forms controls in HTML documents. Hosting the runtime in this way makes managed mobile code (similar to Microsoft® ActiveX® controls) possible, but with significant improvements that only managed code can offer, such as semi-trusted execution and isolated file storage. The figure shows the relationship of the common language runtime and the class library to your applications and to the overall system. It also shows how managed code operates within a larger architecture.


B) Assemblies in .Net: 


The .NET Framework class library is a collection of reusable types that tightly integrate with the common language runtime. The class library is object oriented, providing types from which your own managed code can derive functionality. This not only makes the .NET Framework types easy to use, but also reduces the time associated with learning new features of the .NET Framework. In addition, third-party components can integrate seamlessly with classes in the .NET Framework.
For example, the .NET Framework collection classes implement a set of interfaces that you can use to develop your own collection classes. Your collection classes will blend seamlessly with the classes in the .NET Framework. As you would expect from an object-oriented class library, the .NET Framework types enable you to accomplish a range of common programming tasks, including tasks such as string management, data collection, database connectivity, and file access. In addition to these common tasks, the class library includes types that support a variety of specialized development scenarios. For example, you can use the .NET Framework to develop the following types of applications and services:
  • Console applications.
  • Windows GUI applications (Windows Forms).
  • Windows Presentation Foundation (WPF) applications.
  • ASP.NET applications.
  • Web services.
  • Windows services.
  • Service-oriented applications using Windows Communication Foundation (WCF).
  • Workflow-enabled applications using Windows Workflow Foundation (WF).

For example, the Windows Forms classes are a comprehensive set of reusable types that vastly simplify Windows GUI development. If you write an ASP.NET Web Form application, you can use the Web Forms classes.

2. Explain the following with respect to C# programming:
A) Properties and Indexes:

Properties are members that provide a flexible mechanism to read, write, or compute the values of private fields. Properties can be used as if they are public data members, but they are actually special methods called accessors. This enables data to be accessed easily and still helps promote the safety and flexibility of methods.
Properties Overview:
• Properties enable a class to expose a public way of getting and setting values, while hiding implementation or verification code.
• A get property accessor is used to return the property value, and a set accessor is used to assign a new value. These accessors can have different access levels.

• The value keyword is used to define the value being assigned by the set indexer.

• properties that do not implement a set method are read only.

Using Properties:

Properties combine aspects of both fields and methods. To the user of an object, a property appears to be a field, accessing the property requires the same syntax. To the implementer of a class, a property is one or two code blocks, representing a get accessor and/or a set accessor. The code block for the get accessor is executed when the property is read; the code block for the set accessor is executed when the property is assigned a new value. A property without a set accessor is considered read-only. A property without a get accessor is considered write-only. A property that has both accessors is read-write. Unlike fields, properties are not classified as variables. Therefore, you cannot pass a property as a ref (C# Reference) or out (C# Reference) parameter. Properties have many uses: they can validate data before allowing a change; they can transparently expose data on a class where that data is actually retrieved from some other source, such as a database; they can take an action when data is changed, such as raising an event, or changing the value of other fields. Properties are declared in the class block by specifying the access level of the field, followed by the type of the property, followed by the name of the property, and followed by a code block that declares a get-accessor and/or a set accessor.
The get Accessor: The body of the get accessor resembles that of a method. It must return a value of the property type. The execution of the get accessor is equivalent to reading the value of the field. For example, when you are returning the private variable from the get accessor and optimizations are enabled, the call to the get accessor method is in lined by the compiler so there is no method-call overhead. However, a virtual get accessor method cannot be in lined because the compiler does not know at compile-time which method may actually be called at run time.

Set Accessor: 

The set accessor resembles a method whose return type is void. It uses an implicit parameter called value, whose type is the type of the property.

B) Delegates and Events
An event is a message sent by an object to signal the occurrence of an action. The action could be caused by user interaction, such as a mouse click, or it could be triggered by some other program logic. The object that raises the event is called the event sender. The object that captures the event and responds to it is called the event receiver. In event communication, the event sender class does not know which object or method will receive (handle) the events it raises. What is needed is an intermediary (or pointer-like mechanism) between the source and the receiver. The .NET Framework defines a special type (Delegate) that provides the functionality of a function pointer.
A delegate is a class that can hold a reference to a method. Unlike other classes, a delegate class has a signature, and it can hold references only to methods that match its signature. A delegate is thus equivalent to a type-safe function pointer or a callback. While delegates have other uses, the discussion here focuses on the event handling functionality of delegates. A delegate declaration is sufficient to define a delegate class. The declaration supplies the signature of the delegate, and the common language runtime
provides the implementation. The following example shows an event delegate declaration.


Events:
Events enable a class or object to notify other classes or objects when something of interest occurs. The class that sends (or raises) the event is called the publisher and the classes that receive (or handle) the event are called subscribers.
In a typical C# Windows Forms or Web application, you subscribe to events raised by controls such as buttons and list boxes. You can use the Visual C# integrated development environment (IDE) to browse the events that a control publishes and select the ones that you want to handle. The IDE automatically adds an empty event handler method and the code to subscribe to the event.
Events Overview :
Events have the following properties:

• The publisher determines when an event is raised; the subscribers determine what action is taken in response to the event.
• An event can have multiple subscribers. A subscriber can handle multiple events from multiple publishers.

• Events that have no subscribers are never called.

• Events are typically used to signal user actions such as button clicks or menu selections in graphical user interfaces.

• When an event has multiple subscribers, the event handlers are invoked synchronously when an event is raised. To invoke events asynchronously, see Calling Synchronous Methods Asynchronously.

• Events can be used to synchronize threads.

• In the .NET Framework class library, events are based on the EventHandler delegate and the EventArgs base class.


3. Explain the following with respect to ASP.Net:
A) Master Pages:
Master Pages – The Master Pages feature provides the ability to define common structure and interface elements for your site, such as a page header, footer, or navigation bar, in a common location called a "master page", to be shared by many pages in your site. This improves the maintainability of your site and avoids unnecessary duplication of code for shared site structure or behavior.
Just as Themes and Skins allow you to factor out style definitions from your page code and maintain them in a common file, Master Pages do the same for page layout. A Master Page is a page that contains markup and controls that should be shared across multiple pages in your site. For example, if all of your pages should have the same header and footer banners or the same navigation menu, you could define this in a Master Page once, and then all pages associated to this Master Page would inherit those common elements. The advantage of defining the header, footer, and navigation in a Master Page is that these elements need only be defined once, instead of multiple times in duplicate code across the pages in your site. The Master Pages are an easy way to provide a template that can be used by any number of ASP.NET pages in your application. In working with Master Pages, the developer creates a Master File that is the template referenced by a subpage or Content Page. Master Pages use a .master file extension, whereas content pages use the .aspx file extension you are used to; but content pages are declared as such within the file’s page directive.
Master and Content Pages :
Defining a Master Page is just like defining a normal page. Master Pages can contain markup, controls, or code, or any combination of these elements. However, a Master Page can contain a special type of control, called a ContentPlaceHolder control. A ContentPlaceHolder defines a region of the master page rendering that can be substituted with content from a page associated to the master. A ContentPlaceHolder can also contain default content, just in case the derive page does not need to override this content. The syntax of a ContentPlaceHolder control is given below:
<%-- ContentPlaceHolder control --%>

<%-- ContentPlaceHolder with default content --%>


To differentiate a Master Page from a normal page, a Master Page is saved under the .master file extension. A page can derive from a Master Page by defining a MasterPageFile attribute on its Page directive, as demonstrated below. A page that is associated to a Master Page is called a Content Page.
<%@ Page MasterPageFile="Site.master" %>
A Content Page can declare Content controls that specifically override content placeholder sections in the Master Page. A Content control is associated to a particular ContentPlaceHolder control through its ContentPlaceHolderID property. A Content Page may only contain markup and controls inside Content controls; it cannot have any top-level content of its own. It can, however, have directives or server-side code.
<%@ Page MasterPageFile="Site.master" %>

With sunshine, water, and careful tending, roses will bloom several times in a season.
B) Themes & Control Skins
Creating Themes:
Themes and Skins: The Themes and Skins feature of ASP.NET allows you to factor style and layout information into a separate group of files, collectively called a Theme. A Theme can then be applied to any site to affect the look and feel of pages and controls within the site. Style changes to a site can then be easily maintained by making changes to the Theme, without having to edit the individual pages in your site. Themes can also be shared with other developers. When you build a web application, it usually has a similar look-and-feel across all its pages. Not too many applications are designed with each page dramatically different from each other. In general, your applications use similar fonts, colors, and server control styles across all the pages within the application. You can apply these common styles individually to each and every server control or objects on each page, or you can use a capability provided by ASP.NET to centrally specify these styles. All pages or parts of pages in the application can then access them. Themes are the text-based style definitions in ASP.NET. You create .skin files in the Theme folder. A .skin file can contain one or more control skins for one or more control types. You can define skins in a separate file for each control or define all the skins for a theme in a single file.
There are two types of control skins, default skins and named skins:
A Default Skin automatically applies to all controls of the same type when a theme is applied to a page. A Control Skin is a default skin if it does not have a SkinID attribute. For example, if you create a default skin for a Calendar control, the control skin applies to all Calendar controls on pages that use the theme. (Default skins are matched exactly by control type, so that a Button control skin applies to all Button controls, but not to LinkButton controls or to controls that derive from the Button object.) A Named Skin is a control skin with a SkinID property set. Named skins do not automatically apply to controls by type. Instead, you explicitly apply a named skin to a control by setting the control's SkinID property. Creating named skins allows you to set different skins for different instances of the same control in an application.
 

Cascading Style Sheets:
A theme can also include a cascading style sheet (.css file). When you put a .css file in the theme folder, the style sheet is applied automatically as part of the theme. You define a style sheet using the file name extension .css in the theme folder. The following are the uses of ASP.NET Themes:

They enable you to define visual styles for your Web Pages
They also allow you to apply styles, graphics
They allow you to apply the CSS files themselves to the pages of an application
They can be applied at the application, page, or server control level. STLNET



This simple page shows some default server controls, but which you can change with one of these new ASP.NET themes. You can instantly change the appearance of this page without changing the style of each server control on the page. From within the Page directive, you simply apply an ASP.NET theme that you have either built or downloaded from the Internet: <%@ Page Language = “VB” Theme = “SmokeAndGlass” %> Adding the Them attribute changes the appearance of everything on the page that is defined in an example SmokeAndGlass theme file. If you have multiple pages, you do not have to think about applying styles to everything you do as you build because the styles are already defined centrally for you.
 

Applying a Theme to an Entire Application:
You can apply a Theme to your entire application using the web.config file.
By specifying the Theme in your web.config file, you need not define the theme again in the Page directive of your ASP.NET pages. This theme is applied automatically to each and every page within your application. In order to apply the theme to only a specific part of an application, make use of the element to specify the areas of the application for which the theme should be applied.
Removing Themes from the Server Controls:
Some times you want an alternative to the theme that has already been defined. As an example, to change the text box server control that you have been already working with by making its background black and using white text:

To apply a theme to your ASP.NET page but not to the Textbox control, use the EnableTheming property of the Textbox Server Control:

To turn off the theming property for multiple controls within a page, consider using the Panel Control (or any Container Control) to encapsulate a collection of controls and then set the EnableTheming attribute of the Control Panel to false. This disables the theming for each and every control within the panel.
Creation of User-Defined Themes:
Users can define their own themes to the pages they would create within an application. These themes created can be applied at the following levels within an application:

  • Application Level
  • Page Level
  • Server Control Level
Themes are a way of applying a consistent look and feel across entire application. To create your own themes at first, you have to create a proper folder structure in your application.
Step1: Right click the project and add a new folder
Step 2: Name the folder appropriately (for example: App_Themes)
Step 3: You can also create this folder by right – clicking on your project in Visual Studio and selecting Add ASP.NET Folder Theme.


4. Describe the theory of Server Controls in ASP.Net
 

ASP.NET Server Controls:
ASP.NET Web Server controls are objects on ASP.NET Web pages that run when the page is requested and render markup to a browser. Many Web server controls are similar to familiar HTML elements, such as buttons and text boxes. Other controls encompass complex behavior, such as calendar controls, and controls that manage data connections. ASP.NET Web Server Controls Overview When you create ASP.NET Web pages, you can use these types of controls:

HTML Server Controls: They are the HTML elements exposed to the server so you can program them. HTML server controls expose an object model that maps very closely to the HTML elements that they render.

Web Server Controls: They are the Controls with more built-in features than HTML server controls. Web server controls include not only form controls such as buttons and text boxes, but also special-
purpose controls such as a calendar, menus, and a tree view control. Web server controls are more abstract than HTML server controls in that their object model does not necessarily reflect HTML syntax.

Validation Controls: They are the Controls that incorporate logic to enable you to what users enter for input controls such as the TextBox control. Validation controls enable you to check for a required field, to test against a specific value or pattern of characters, to verify that a value lies within a range, and so on.

User Controls: They are the Controls that you create as ASP.NET Web pages. You can embed ASP.NET user controls in other ASP.NET Web pages, which is an easy way to create toolbars and other reusable elements.

HTML Server Controls:

 
HTML server controls are HTML elements (or elements in other supported markup, such as XHTML) containing attributes that make them programmable in server code. By default, HTML elements on an ASP.NET Web page are not available to the server. Instead, they are treated as opaque text and passed through to the browser. However, by converting HTML elements to HTML server controls, you expose them as elements you can program on the server. The object model for HTML server controls maps closely to that of the corresponding elements. For example, HTML attributes are exposed in HTML server controls as properties.
Any HTML element on a page can be converted to an HTML server control by adding the attribute runat="server". During parsing, the ASP.NET page framework creates instances of all elements containing the runat="server" attribute. If you want to refer to the control as a member within your code, you should also assign an id attribute to the control.
The page framework provides predefined HTML server controls for the HTML elements most commonly used dynamically on a page: the form element, the input elements (text box, check box, Submit button), the select element, and so on. These predefined HTML server controls share the basic properties of the generic control, and in addition, each control typically provides its own set of properties and its own event.

HTML Server Control Features:

• An object model that you can program against on the server using familiar object-oriented techniques. Each server control exposes properties that enable you to manipulate the control's markup attributes programmatically in server code.

• A set of events for which you can write event handlers in much the same way you would in a client-based form, except that the event is handled in server code.

• The ability to handle events in client script.

• Automatic maintenance of the control's state. When the page makes a round trip to the server, the values that the user entered into HTML server controls are automatically maintained and sent back to the browser.

• Interaction with ASP.NET validation controls so you can verify that a user has entered appropriate information into a control.

• Data binding to one or more properties of the control.

• Support for styles if the ASP.NET Web page is displayed in a browser that supports cascading style sheets.

• Pass-through of custom attributes. You can add any attributes you need to an HTML server control and the page framework will render them without any change in functionality. This enables you to add browser-specific attributes to your controls.

Working with Web Server Controls:

 
Web server controls are a second set of controls designed with a different emphasis. They do not necessarily map one-to-one to HTML server controls. Instead, they are defined as abstract controls in which the actual markup rendered by the control can be quite different from the model that you program against. For example, a RadioButtonList Web server control might be rendered in a table or as inline text with other markup. Web server controls include traditional form controls such as buttons and text boxes as well as complex controls such as tables. They also include controls that provide commonly used form functionality such as displaying data in a grid, choosing dates, displaying menus, and so on. The controls use syntax such as the following:

The attributes in this case are not those of HTML elements. Instead, they are properties of the Web control. When the ASP.NET Web page runs, the Web server control is rendered on the page using appropriate markup, which often depends not only on the browser type but also on settings that you have made for the control. For example, a TextBox control might render as an input tag or a textarea tag, depending on its properties. You add controls to an ASP.NET Web page much the same way you add any HTML element. You can either use a visual designer and add a control from the toolbox, or you can type the element representing the control into the page's markup.
To add a Web server control using the designer:

1. Switch to Design view.
2. From the Standard tab of the Toolbox, drag the control onto the page. A glyph () appears on the control in Design view to indicate that it is a server-based control.


To add a control to an ASP.NET Web page programmatically

1. Create an instance of the control and set its properties, as shown in the following example:
C# Code
Label myLabel = new Label();
myLabel.Text = "Sample Label";

2. Add the new control to the Controls collection of a container already on the page, as shown in the following example:
C# Code
Panel Panel1= new Panel();
Panel1.Controls.Add(myLabel);

How to: Set ASP.NET Web Server Control Properties:
Setting a control's properties defines its appearance and behavior. This topic addresses how to set control properties declaratively.
To set server controls properties:
In the ASP.NET Web page, set the attribute of the control declaration corresponding to the property you want.
The exact attribute you set depends on the control and the property. For information about the properties for a specific control, search for the name of the control class (for example, "Button class (System.Web.UI.WebControls)" in the Help index.

Setting Server Control Properties Based on Simple Values or Enumerations :
If a Web server control property's data type is a primitive type, such as a String, Boolean, or numeric type, you can set the property value by simply assigning it to the property. Similarly, if the property's values are defined in an enumeration class, you can simply assign the enumeration to the property.
To set a property value based on simple values

Assign the value as a literal or variable, as in the following example:
C# Syntax
Label1.Text = "Hello";
DataGrid1.PageSize = 5;

Popular Posts

Recent Posts

sponser

ugc net exam

Blog Archive