Your SlideShare is downloading. ×
0
Test Driven Development with ASP.NET MVC 1.0 Shiju Varghese http://weblogs.asp.net/shijuvarghese
Session Objectives <ul><li>Introduction to ASP.NET MVC </li></ul><ul><li>Introduction to TDD </li></ul><ul><li>Demonstrate...
What’s wrong with ASP.NET WebForm <ul><li>ViewState </li></ul><ul><li>Page life cycle </li></ul><ul><li>Limited control ov...
What is MVC <ul><li>A design pattern </li></ul><ul><li>Acronym for Model View Controller </li></ul><ul><li>Isolating busin...
What is MVC <ul><li>View is just concerned about presentation logic </li></ul><ul><li>Models represent the data </li></ul>...
What is ASP.NET MVC <ul><li>An alternative framework to ASP.NET Web Forms. </li></ul><ul><li>More control over your HTML <...
Goals of ASP.NET MVC Framework <ul><li>Enable clean separation of concerns </li></ul><ul><ul><li>Each component has one re...
Goals of ASP.NET MVC Framework <ul><li>Extensible and Pluggable framework. </li></ul><ul><ul><li>Interface-based architect...
Test Driven Development <ul><li>Requirement identified </li></ul><ul><li>Write an automated test </li></ul><ul><li>Run tes...
Test Driven Development <ul><li>Unit Test Frameworks for .NET: </li></ul><ul><ul><li>NUnit </li></ul></ul><ul><ul><li>Visu...
Mock Objects <ul><li>In object-oriented programming, mock objects are simulated objects that mimic the behavior of real ob...
Demo
Questions?
Thanks Shiju Varghese E-Mail :  [email_address] Blog :  http:// weblogs.asp.net/shijuvarghese Twitter :  http:// twitter.c...
Upcoming SlideShare
Loading in...5
×

TDD with ASP.NET MVC 1.0

1,363

Published on

TDD with ASP.NET MVC 1.0

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,363
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
40
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "TDD with ASP.NET MVC 1.0"

  1. 1. Test Driven Development with ASP.NET MVC 1.0 Shiju Varghese http://weblogs.asp.net/shijuvarghese
  2. 2. Session Objectives <ul><li>Introduction to ASP.NET MVC </li></ul><ul><li>Introduction to TDD </li></ul><ul><li>Demonstrate TDD with ASP.NET MVC </li></ul>
  3. 3. What’s wrong with ASP.NET WebForm <ul><li>ViewState </li></ul><ul><li>Page life cycle </li></ul><ul><li>Limited control over rendered HTML </li></ul><ul><li>Lack of Separation of Concerns (SoC) </li></ul><ul><li>Untestable </li></ul>
  4. 4. What is MVC <ul><li>A design pattern </li></ul><ul><li>Acronym for Model View Controller </li></ul><ul><li>Isolating business logic from UI </li></ul><ul><li>Layering for UI layer </li></ul><ul><li>Separation of Concerns (SoC) </li></ul><ul><ul><li>Separate content from presentation and data-processing (model) from content </li></ul></ul>
  5. 5. What is MVC <ul><li>View is just concerned about presentation logic </li></ul><ul><li>Models represent the data </li></ul><ul><li>Controllers just handle application flow </li></ul><ul><li>You write less code and end up with a more maintainable application. </li></ul>
  6. 6. What is ASP.NET MVC <ul><li>An alternative framework to ASP.NET Web Forms. </li></ul><ul><li>More control over your HTML </li></ul><ul><li>A more easily testable framework </li></ul><ul><li>Simply an option </li></ul><ul><ul><li>Will not a replacement for Web Form </li></ul></ul><ul><ul><li>Build on top of ASP.NET </li></ul></ul><ul><li>Opinionated Framework </li></ul><ul><ul><li>Community Driven Framework </li></ul></ul>
  7. 7. Goals of ASP.NET MVC Framework <ul><li>Enable clean separation of concerns </li></ul><ul><ul><li>Each component has one responsibility </li></ul></ul><ul><ul><ul><li>Single Responsibility Principle (SRP) </li></ul></ul></ul><ul><ul><ul><li>Highly testable and maintainable application </li></ul></ul></ul><ul><li>Testable by default (built with TDD in mind) </li></ul><ul><ul><li>Red/Green/Refactor TDD </li></ul></ul><ul><li>Enable full control over the rendered HTML </li></ul><ul><li>Enable clean URLs and HTML </li></ul><ul><ul><li>SEO and REST friendly URL structures </li></ul></ul>
  8. 8. Goals of ASP.NET MVC Framework <ul><li>Extensible and Pluggable framework. </li></ul><ul><ul><li>Interface-based architecture </li></ul></ul><ul><ul><li>Support replacing any component of the system </li></ul></ul><ul><ul><li>Support third-party view engines such as NVelocity, Brail, NHaml </li></ul></ul><ul><ul><li>Support user-provided front controller that enable Inversion of Control containers </li></ul></ul><ul><li>Build on top of ASP.NET </li></ul><ul><li>Support static and dynamic languages </li></ul><ul><li>Conventions and Guidance </li></ul>
  9. 9. Test Driven Development <ul><li>Requirement identified </li></ul><ul><li>Write an automated test </li></ul><ul><li>Run tests and make sure new one FAILS </li></ul><ul><li>Write some code </li></ul><ul><li>Run tests to make sure all PASS </li></ul><ul><li>Refactor </li></ul><ul><li>Repeat </li></ul>
  10. 10. Test Driven Development <ul><li>Unit Test Frameworks for .NET: </li></ul><ul><ul><li>NUnit </li></ul></ul><ul><ul><li>Visual Studio Test Framework </li></ul></ul><ul><ul><li>xUnit.NET </li></ul></ul>
  11. 11. Mock Objects <ul><li>In object-oriented programming, mock objects are simulated objects that mimic the behavior of real objects in controlled ways. </li></ul><ul><ul><li>Moq </li></ul></ul><ul><ul><li>Rhino Mocks </li></ul></ul>
  12. 12. Demo
  13. 13. Questions?
  14. 14. Thanks Shiju Varghese E-Mail : [email_address] Blog : http:// weblogs.asp.net/shijuvarghese Twitter : http:// twitter.com/shijucv
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×