Asp.NET Web Development Process
This document helps define a development process for the entire project life cycle.Requirements Gathering
A “requirement” is simply a statement of what the business needs to accomplish. At a high level, the business case or justification for the project should be defined as a requirement(s). Then by analysis of this high level requirement(s), additional requirements will flow at an increasing level of detail.
The requirements gathering process results in a living document that will continue to change and grow throughout the project life cycle. Requirements will continue to be refined in the analysis phase.
Here are some guidelines for requirements gathering:The requirement must be from the business perspective. Every requirement should be clear from the client’s perspective and be relevant to their business needs. This is the time to focus on the business side of things. Keep the technical “how” out of the discussion until all the business requirements are clearly defined. This will keep the project focused on what the business needs.
Come prepared to the first requirements gathering meeting with the start of a requirements document. You should have enough in the requirements document, even if it’s 100% assumptions, to help facilitate the gathering process by engaging the client. Even making the wrong assumptions about things are helpful as it will help facilitate feedback and get the client thinking about their needs.
While technical implementation details do not belong in this document, your perspective on the requirements will help you ask the “right” questions. You should use your experience to facilitate the client thinking about the “right” things, and to help uncover business requirements the client would not normally think about. For example; validation and data rules, data security, web site security, privacy, integration with other systems, reporting, exporting, etc are all business requirements.
Follow leads based on the clients’ responses and continue to push until you get concrete answers. The wording should be definite with terms like "must", "will", or "shall". Avoid terms that leave options open like "could" or "may". If concrete answers cannot be determined for a given requirement, flag them and then use the Analysis phase to dig deeper until you get to the bottom of it.
Get customer approvals of all requirements. You will want to fill in blanks on behalf of the business, but if you do, make sure you always get customer approval for your assumptions.
The requirement should be testable. Ask yourself how you would generally go about testing a requirement. Since the system isn't built, you have to make assumptions about user interface and the like. At a very high level, get the test plan outlined with a short statement on how each requirement should be tested. If you find it difficult to come up with a test or a description of how a test should work, evaluate the requirement to see if it should be better written, is too costly to implement, or isn't practical.
Estimating – Use the following formulas for calculating ranges for estimating based on your requirements.
Order of Magnitude (Done during Initiating) - 25% to +75%
Budget Estimate (Done during Planning) -10% to +25%
Definitive Estimate (Done during Planning) - 5% to +10%
Analysis
Analysis is the process of refining requirements and defining the processes for the solution. Analysis is still business centric (meaning it’s from the business perspective and makes sense to the client), but the objective is more technical. At the end of the Analysis Phase, you should have enough details about each requirement to “Design” the solution.Analysis normally takes the form of Use Cases, but can also include:
Demo’s
Wire-frames
Prototypes
A Use Case is a narrative form of a process that is needed to meet each requirement. See Appendix A for a template.
Identify actors. An actor is a user of the system or other system that interacts with this one.
Build Use Cases for each concrete requirement.
Associate Use Cases with an Actor and make sure the Use Case is from the Actor’s perspective.
Define how data will be collected and used.
Will they need to report on this data?
Will 3rd party systems need to use it?
Is there a need to export this data? To what formats?
What validation rules should be required?
Define where data will come from that is required by the Use Case.
Will someone be entering the data?
Is the data static, or something that needs to change regularly?
Is the data coming from a 3rd party system?
Is the data dependent on a previous process being completed in this solution?
Use Cases should be complete and approved by the client before entering the “Design” phase.
Design
Design is the process of taking solidified Use Cases (and related Requirements), and translating them into a Solution Design. This Solution Design should clearly communicate to a developer how the solution should be written. A Solution Design should contain:Static Structure – This UML diagram will define all objects in the solution. In lieu of a diagram, the Business Layer can be used to build these object directly, as long as they are documented as to which use case and requirements they are designed to meet. Use Case nouns are potential objects (business and data access objects), and verbs potential operations.
Sequence Diagrams – These UML diagrams should map to a specific Use Case and show how the objects identified in the Static Structure for this Use Case will be used to accomplish the intended outcome.
Prototypes and wire-frames – This should define how the UI should look and function.
Construction
Construction is the process of taking the culmination of knowledge from the Analysis and Design phases to produce code for the solution. While construction doesn’t require that all of the Analysis and Design be completed for the entire solution before any code is written, it does require that:All major components of the solution are defined at a high level.
Dependencies and communication requirements between these components are identified.
Requirements and Design artifacts are completed and approved (if necessary) for the component being developed.
Construction standards are strictly followed during the construction phase of the project. While these standards are not the only way to do things, it is necessary to adopt one way for consistency and interoperability during the construction and integration of a solution. Here is a list of these standards:
Camel Casing
Camel casing occurs when all words of an identifier are capitalized, except for the first word. The identifiers firstName, productId, and email are all examples of using camel casing.Use camel casing for private type fields, parameters, and local variables.
Pascal Casing
Pascal casing occurs when the first letter of every word in an identifier is capitalized. ProductName, CompanyName, and Email are examples of PascalCasing.Use Pascal casing everywhere except for when you use camel casing. For example, property names, operations, and tables.
Field, Local Variable, and Parameter Naming
Fields are variables declared at the type level. Local variables are declared within methods, property accessors, and indexer accessors. Parameters are part of the declaration of methods, indexers, and delegates and enable code to pass arguments.Prefix field names with "_". The identifiers _firstName, _companyId, and _email are proper field names.
Don't prefix Local variables and parameters. The identifiers firstName, companyId, and primaryEmailAddress are valid local variables.
UI Elements
UI Elements should be explicitly named if it is referenced anywhere on the page or in the code-behind.UI Elements should be prefixed to show what type of UI element it is: “lbl” for Label, “txt” for TextBox, etc.
They should have “friendly” names that are applicable to how that control is being used.
Delegates and Events
Event names can use the VS assigned convention, but be sure the parent control has been named appropriately before the event is created.
Name Delegates with a “Handler” Suffix.
Software Development Methodology
During the construction phase, a Software Development Methodology is used to improve overall quality of the solution, as well as enhance flexibility and maintenance over the lifecycle of the application. This methodology follows best practices of n-tier software design to separate out UI, Business and Data Access layers into separate manageable pieces of the application.High Cohesion
OO design is highly cohesive when the objects are singular in their purpose and their purpose is well thought out and maintained.
This also means that at a smaller level, your methods should follow the same general rule. Methods should be as simple and concise as possible. It is better to have several smaller methods to carry out a specific operation, then to have one large method that is harder to read and therefore debug.
Loosely Coupled
OO design is loosely coupled when the application, and it’s parts, are independent in their nature. Meaning, the application, one of it’s components, or a single object can be modified without have a ripple effect in the rest of the system, or to other systems
The way this is accomplished is by designing for high cohesions at the system, component, object, and method level, and carefully handling the communication at each one of these levels to reduce the dependency at each.Interfaces
Interfaces should be used to provide all up-stream access between layers. Interfaces should also be considered when an object is shared among multiple Managers (UI processes) as an additional layer of abstraction.User Interface Layer
User Interface Layer is the GUI of the application. For ASP.NET applications, this includes the ASPX and ASPX code-behind.Use .NET UI components – In all instances possible, .NET components should be utilized for the GUI.
Use Object Data Sources – This provides design view readability into the BLL and DAL process without loosing encapsulation.
Use the code-behind – Avoid writing any embedded code with the UI. Instead, utilize the code-behind.
Use Master Pages, Skins, and Themes – This will provide encapsulation of design from the actual ASPX pages. Doing this will provide consistency for the look and feel, as well as ease of managing changes to the design in the future.
Use Cascading Style Sheets – CSS should be the primary layout means for overall UI control and design. Avoid using tables, inline styles and outdated formatting options (I.E. font tags).
Business Layer
The business layer contains object that encapsulate the domain of business logic for the application.
This domain has two objectives:
1. Abstract the UI from data access and business logic.
2. Provide communication between the UI and BLL/DAL.
To accomplish the domain’s objectives, we’ve adopted the following standard objects:Managers – Manager objects are used in the code-behind of the aspx page as well as in the DAL (see Data-Access Layer below). They provide single-point-access for all BLL (explicit) and DAL (implicit) functions the application needs to accomplish from the UIL.
Data-Access Layer
The data-access layer provides mechanisms for retrieving and populating data into BLL objects.Gateways – Gateways are the primary data-access objects. They work in conjunction with a reference to a “Manager” to create business objects and populate them will data.
For BLL access use Interfaces – Because business objects are upstream from the DAL, all interaction with this layer should be handles through interfaces. Additionally, interaction with the BLL should be isolated to using “Managers”.
Use parameters when creating your queries by using the SqlCommand object.
Populate BLL objects – In general, business objects should be used to populate with data.
Here are some exceptions to this rule:You are doing a data-centric operation (requires no business logic). For example, binding search results to a data grid.
You want to provide a generic data transport. For example, when using web services datasets can provide a very agnostic data transport mechanism. Datasets can also easily translate to XML.
Read – This would involve any “Select” type operation.
Use Views – This will provide a layer of abstraction for the underlying table structure.
Utilize the “Managers” to create needed BLL objects and perform other business related functions.
Create methods specifically for populating BLL objects from data readers.
Only send in what is necessary from the BLL to retrieve the data. This typically means a primary key.
Return populated BLL objects to the “Manager”.
Create – This would include any “Insert” type operation.
Send in the BLL object containing the data for the insert operation. Remember, this must be referenced as an interface.
Use transactions when inserting into multiple tables at once.
Return the updated BLL object to the “Manager”.
Delete – In general, deletes take two forms:
A Soft delete – This flags a record as deleted, but doesn’t actually delete the record.
A Hard delete – This actually deletes a record from the database.Both “Hard” and “Soft” deletes should be written into the DAL, typically only utilizing the “Soft” delete from the UIL.
Use transactions when deleting from more then one table.
Only send in what is necessary from the BLL to retrieve the data. This typically means a primary key.
Update – This would be any “Update” type operation.
Send in the BLL object containing the data to use for the update operation. Remember, this should be referenced as an interface.
Use transactions when updating more then one table.
Return the updated object to the “Manager”.
Test
Testing is the process of ensuring quality of the solution. The solutions quality is measured by how well it handles defined requirements, and how well it performs in that capacity.
Testing preparation starts at the Analysis phase by analyzing requirements to determine how to test for each. Then, as construction for each requirement takes place, testing is done to ensure that the constructed artifact does in fact meet the requirements it was designed to. Testing is continued throughout deployment to ensure quality at the solution level.
Testing procedures:Unit Testing – This is the process of testing highly specialized parts of the system to make sure they handle their specific requirements correctly before they are integrated into larger components.
Component Testing – Component Testing will ensure that as highly specialized artifacts are brought together to build larger components of the overall system, they will continue to perform their specialized requirements and work together to accomplish a larger set of required functionality.
Integration Testing – Integration Testing is the process of testing component as they are integrated together to compose a functional piece of the solution. Testing is done to ensure the component meets requirements as defined for the component and that the integrated set of components meets overall business requirements for the solution as a whole.
Regression Testing – Regression Testing is the process of testing peripheral functionality (functionality outside of what was explicitly changed or added) to ensure changes did not have negative impact to any part of the system.
Usability Testing – Usability Testing will ensures that working parts of the solution have acceptable usability based on business requirements.
Acceptance Testing – As a final step of the testing process, clients/end users will have an opportunity to test working parts of the solution to make sure it meets their expectations as was defined during the Requirements and Analysis phases of the project.
Deploy
Deployment is the process of moving tested functional parts of the solution resulting from the Construction phase into a different environment. This environment can be integration with overall solution in a development environment, moving the solution to a test or production environment, or integrating the solution with a 3rd party system. Before this can happen the following must be true:The artifact has been tested to make sure it meets the requirements as defined by the business.
The artifact has been tested to ensure that is performs these operations well; without error and with proper usability.
The artifact has been tested to ensure interoperability with the rest of the solution and any dependent systems (Regression Testing).
Appendix A – Use Cases Guidance/Template
The following table describes the elements you should add to your Use Case diagrams:
| Section Title | Description |
| UC Name | ID of Use Case – i.e. 1.2.3. Can use Tag in Visio. |
| Actor | Person or System performing Use Case tasks. Represented as part of Use Case diagram. |
| Requirement | ID from requirements documentation. – i.e. 1.2.3. Provides tracability. Can use Tag in Visio. |
| Pre-condition | Pertinent facts that must be true about the system prior to beginning tasks. |
| Tasks | Flow of work that actor engages in to accomplish Use Case. Represents the "normal" flow.
Alterations of the flow should go in Task Exceptions. For any significant alterations, or any task sequences that differ significantly from the normal flow or are hard to describe in a sequence diagram, create a new Use Case and rename present Use Case to be more specific.
If you encounter the same task sequence across two or more Use Cases, break the subset of tasks into their own Use Case and reference the new Use Case with an Extends or Uses association. |
| Task Exceptions | Paths that alter the normal task flow should be documented as Task Exceptions. If the exception is significant, consider creating a new Use Case and renaming the present Use Case to something more specific. |
| Post-condition | Pertinent facts that must be true about the system after completion. |
| Notes | Create a note for anything that doesn't fit in other categories. i.e. assumptions, business rules, and constraints. |
Use the following item as a template. Documentation is provided separately, in the table above, so you can easily copy and paste this template:
UC Name:
Actor:
Requirement:
Pre-condition:
Tasks:
Task Exceptions:
Post-condition:
Notes: