In this tutorial you will learn the basics of ASP.NET and how to use TDD. This will allow you to write a simple ASP.NET site that you will then run. The program will be a visual studio application
About this Tutorial
Objectives
Delegates will learn to develop web applications using C# 4.0. After completing this course, delegates will be able to:
- Use Visual Studio 2012 effectively
- Create commercial ASP.NET Web Applications
- Develop user interfaces using Master Pages, Site Navigation and Themes
Audience
This course has been designed primarily for programmers new to the .Net development platform. Delegates experience solely in Windows application development or earlier versions of ASP.Net will also find the content beneficial.
Prerequisites
No previous experience in ASP.NET programming is required. But any experience you do have in programming will help. Also no experience in visual studio is required. But again any experience you do have with programming development environments will be a valuable.
Experience using a contemporary OO language such as C++ or C# would be useful but is not required.
Quick Access
Overview
Estimated Time – 40 minutes
Not what you are looking? Try the next tutorial – ASP.NET MVC4 View Techniques
In this tutorial we will go into a in-depth look into the TDD (Test Driven Development) and the use of this with ASP.NET MVC4
By the end of the tutorial you should have a working application that enables the user to view multiple pages. This new feature will be added with TDD.
How about a training course? View Course Outline.
-
The Software created by TDD should be Flexible, maintainable software that is defect-free, How?
- Each small part of the software is tested as we go along.
- Software designed to be tested.
-
Code Unit is the smallest testable application part. Unit Test is a strict written contract that a code must satisfy.
- This ensures code unit meets design.
- Satisfies Requirements.
- Behaves as intended.
- Asserts conditions to be met.
-
Characteristics of a Unit Test
- Isolated and focused – only one thing at a time.
- Self-contained – no need to rely on external information.
- Fast – Otherwise why run them.
- Repeatable – Aids regression testing.
-
Test First, Code Later.
- For each new feature, write a test first.
- Define code requirements before writing code.
- Test based on common use cases.
- Acceptance test to test the big picture.
- Unit test to test the implementation.
-
Red, green, Re-factor.
- Write a test to express how code is used and what it must do to support a new feature – This test will fail.
- Write enough code to pass the test, no more.
- Re-factor – Clean code to remove redundancy and improve design.
- Re-run tests to make sure it will still pass.
- Repeat until done.
Benefits of using TDD and unit test
-
Ability to work in small steps.
- Start small-scale with obvious tests.
- Problem becomes less daunting as you write more tests.
- You can demonstrate progress quickly.
- Code without tests risks being defective.
- TDD guarantees high degree of test coverage – each feature has its own test.
- Reduce uncertainty – proof that your code works.
- Reduce cost of bugs.
Lab 1: TDD with ASP.NET MVC4
Well done. You have completed the tutorial in the MVC4 course. The next tutorial is
4. ASP.NET MVC4 View Techniques
Copyright © 2016 TalkIT®
If you would like to see more content like this in the future, please fill-in our quick survey.