SlideShare a Scribd company logo
Introduction to TDD and CI Antonio Radesca
Test Driven Development Defined by Kent Beck in Test Driven Development By Examples Rules Never write a single line of code unless you have a failing automated test Eliminate duplication
Practices and Tool Nunit,MBUnit... Resharper (Refactoring)‏ Gallio suite
Refactoring Process of rewriting code for improve readability, semplification, performances and design “ Refactoring” by Martin Fowler There you can find more informations and patterns Automated from some tools: VS refactoring, Resharper,Visual Assist...
Some Examples namespace  ERP.UnitTests.Repository.NHibernate { [ TestFixture ] public   class   FixtureNHibernateClientRepository { [ SetUp ] public   void  SetupMethod()‏ { TestUtilities  obj= new   TestUtilities (); obj.ExecuteQuery( "DELETE FROM CLIENTS" ); obj.ExecuteQuery( @"DBCC CHECKIDENT(Clients,RESEED,0)" ); } [ Test ] public   void  SaveClient()‏ { Client  obj= new   Client (); obj.NameSurname =  "name" ; obj.City =  "city" ; obj.Address =  "Address" ; ERP.Repository.NHibernate. ClientRepository  objRep= new   ClientRepository (); objRep.Save(obj); objRep.Commit(); Client  tmp = objRep.Load(1); Assert .AreEqual( true , CompareClients(tmp, obj)); } private   bool  CompareClients( Client  tmp,  Client  obj)‏ { if  (tmp.ID == obj.ID && obj.City == tmp.City && tmp.NameSurname == obj.NameSurname && tmp.Address == obj.Address)‏ return   true ; return   false ; } } }
Behaviour Driven Development TDD + DDD
BDD:Practices A SubjectMatterExpert (typically a business user) works with a BusinessAnalyst to identify a business requirement. This is expressed as a story using the following template As a Role I request a Feature To gain a Benefit  The speaker, who holds the Role, is the person who will gain the Benefit from the requested Feature.
Mocks Do you need to test something that is related to other components?
Rhino Mocks Created by Ayende Simple, documented and updated CODE...
An Example
Continuous Integration Extende and improve build automation Prevent from integration problems Examples:CruiseControl.NET,TFS,Draco.NET...
CI:Practices Maintain a Single Source Repository Automate the Build Make Your Build Self-Testing Everyone Commits Every Day Every Commit Should Build the Mainline on an Integration Machine Keep the Build Fast Test in a Clone of the Production Environment Make it easy to get the latest deliverables Everyone can see the results of the latest build Automate Deployment
Continuous Integration
Introduction to IOC and AOP
Inversion Of Control Good software: High coesion,low coupled
What is IOC From Wikipedia: abstract principle describing an aspect of some software architecture designs in which the flow of control of a system is inverted in comparison to the traditional architecture of software libraries. Instead of specifying a sequence of decisions and procedures to occur during the lifetime of a process, the user of an IoC framework writes the desired responses linked to particular events or data requests. External entities then take control over the precise calling order and additional maintenance that are to be carried out to execute the process.
Example
IOC
Hollywood Principle Don't call us, we'll call you. High cohesion and low coupling
Dependency Injection Dependency Injection (DI) in computer programming refers to the process of supplying an external dependency to a software component. It is a specific form of inversion of control where the concern being inverted is the process of obtaining the needed dependency. The object simply provides a property that can hold a reference to that type of service; and when the object is created a reference to an implementation of that type of service will automatically be injected into that property - by an external mechanism. See Martin Fowler for types...
IOC Framework for .NET Managed Extensibility Framework Autofac Castle MicroKernel/Windsor ObjectBuilder PicoContainer.NET Puzzle.NFactory Spring.NET StructureMap Ninject Unity NauckIT.MicroKernel
Example using  System; using  System.Collections.Generic; using  System.Linq; using  System.Text; using  Castle.Core.Resource; using  Castle.Windsor; using  Castle.Windsor.Configuration.Interpreters; using  Microsoft.Practices.Unity; namespace  ERP.Services { public   interface   IServicesFactory { T GetService<T>(); } public   class   ServicesFactory  :  IServicesFactory { private   static IWindsorContainer  container; static  ServicesFactory()‏ { container =  new   WindsorContainer ( new   XmlInterpreter ( new   ConfigResource ( &quot;notification&quot; ))); } public  T GetService<T>()‏ { return  container.GetService<T>(); } } }
Aspect Oriented Programming
What is an aspect? Paradigm programming based on crosscuts concepts Examples:Logging,Transactions,Caching... AOP Containers:Spring.NET,Castle Windsor,Unity Application Block...
Some Examples using  System; using  System.Collections.Generic; using  System.Linq; using  System.Text; using  Castle.DynamicProxy; using  Utils; namespace  ERP.Services.AOP { //Classe che gestisce il logging instanziando oggetti generici public   class   LoggingManager <T> { public   void  Log<T>( string  method)‏ { ProxyGenerator  generator =  new   ProxyGenerator (); T logger = generator.CreateClassProxy<T>( new   LoggingInterceptor ()); ReflectionHelper .CallMethod(logger,method); } } }
Ad

More Related Content

What's hot (20)

Write readable tests
Write readable testsWrite readable tests
Write readable tests
Marian Wamsiedel
 
Write testable code in java, best practices
Write testable code in java, best practicesWrite testable code in java, best practices
Write testable code in java, best practices
Marian Wamsiedel
 
Real Life Clean Architecture
Real Life Clean ArchitectureReal Life Clean Architecture
Real Life Clean Architecture
Mattia Battiston
 
09 Application Design
09 Application Design09 Application Design
09 Application Design
Ranjan Kumar
 
Jug Guice Presentation
Jug Guice PresentationJug Guice Presentation
Jug Guice Presentation
Dmitry Buzdin
 
Factory pattern in Java
Factory pattern in JavaFactory pattern in Java
Factory pattern in Java
Marian Wamsiedel
 
Aspect-Oriented Programming (AOP) in .NET
Aspect-Oriented Programming (AOP) in .NETAspect-Oriented Programming (AOP) in .NET
Aspect-Oriented Programming (AOP) in .NET
Yuriy Guts
 
Functional Dependency Injection in C#
Functional Dependency Injection in C#Functional Dependency Injection in C#
Functional Dependency Injection in C#
Thomas Jaskula
 
Java Security And Authentacation
Java Security And AuthentacationJava Security And Authentacation
Java Security And Authentacation
ckofoed
 
Android Test Driven Development & Android Unit Testing
Android Test Driven Development & Android Unit TestingAndroid Test Driven Development & Android Unit Testing
Android Test Driven Development & Android Unit Testing
mahmoud ramadan
 
Building a web application with ontinuation monads
Building a web application with ontinuation monadsBuilding a web application with ontinuation monads
Building a web application with ontinuation monads
Seitaro Yuuki
 
Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008
Jonas Follesø
 
STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)
STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)
STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)
pycontw
 
SOLID Principles
SOLID PrinciplesSOLID Principles
SOLID Principles
Teja Swaroop
 
MVC and Entity Framework
MVC and Entity FrameworkMVC and Entity Framework
MVC and Entity Framework
James Johnson
 
Fun with QML
Fun with QMLFun with QML
Fun with QML
ICS
 
React js t2 - jsx
React js   t2 - jsxReact js   t2 - jsx
React js t2 - jsx
Jainul Musani
 
Unit Testing in Java
Unit Testing in JavaUnit Testing in Java
Unit Testing in Java
Ahmed M. Gomaa
 
Let’s template
Let’s templateLet’s template
Let’s template
AllenKao7
 
Applied MyEclipse and JUnit to do Hibernate Code Gen and Testing
Applied MyEclipse and JUnit to do Hibernate Code Gen and TestingApplied MyEclipse and JUnit to do Hibernate Code Gen and Testing
Applied MyEclipse and JUnit to do Hibernate Code Gen and Testing
Guo Albert
 
Write testable code in java, best practices
Write testable code in java, best practicesWrite testable code in java, best practices
Write testable code in java, best practices
Marian Wamsiedel
 
Real Life Clean Architecture
Real Life Clean ArchitectureReal Life Clean Architecture
Real Life Clean Architecture
Mattia Battiston
 
09 Application Design
09 Application Design09 Application Design
09 Application Design
Ranjan Kumar
 
Jug Guice Presentation
Jug Guice PresentationJug Guice Presentation
Jug Guice Presentation
Dmitry Buzdin
 
Aspect-Oriented Programming (AOP) in .NET
Aspect-Oriented Programming (AOP) in .NETAspect-Oriented Programming (AOP) in .NET
Aspect-Oriented Programming (AOP) in .NET
Yuriy Guts
 
Functional Dependency Injection in C#
Functional Dependency Injection in C#Functional Dependency Injection in C#
Functional Dependency Injection in C#
Thomas Jaskula
 
Java Security And Authentacation
Java Security And AuthentacationJava Security And Authentacation
Java Security And Authentacation
ckofoed
 
Android Test Driven Development & Android Unit Testing
Android Test Driven Development & Android Unit TestingAndroid Test Driven Development & Android Unit Testing
Android Test Driven Development & Android Unit Testing
mahmoud ramadan
 
Building a web application with ontinuation monads
Building a web application with ontinuation monadsBuilding a web application with ontinuation monads
Building a web application with ontinuation monads
Seitaro Yuuki
 
Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008
Jonas Follesø
 
STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)
STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)
STAF 在自動化測試上的延伸應用 -- TMSTAF (TrendMicro STAF)
pycontw
 
MVC and Entity Framework
MVC and Entity FrameworkMVC and Entity Framework
MVC and Entity Framework
James Johnson
 
Fun with QML
Fun with QMLFun with QML
Fun with QML
ICS
 
Let’s template
Let’s templateLet’s template
Let’s template
AllenKao7
 
Applied MyEclipse and JUnit to do Hibernate Code Gen and Testing
Applied MyEclipse and JUnit to do Hibernate Code Gen and TestingApplied MyEclipse and JUnit to do Hibernate Code Gen and Testing
Applied MyEclipse and JUnit to do Hibernate Code Gen and Testing
Guo Albert
 

Viewers also liked (8)

Java script tutorial by example
Java script tutorial by exampleJava script tutorial by example
Java script tutorial by example
myzyzy
 
Javascript TDD by example
Javascript TDD by exampleJavascript TDD by example
Javascript TDD by example
Eric Mignot
 
Mock driven development using .NET
Mock driven development using .NETMock driven development using .NET
Mock driven development using .NET
Puneet Ghanshani
 
Unit Testing and Test Driven Development in Unity3D
Unit Testing and Test Driven Development in Unity3DUnit Testing and Test Driven Development in Unity3D
Unit Testing and Test Driven Development in Unity3D
Andrew Fray
 
Tdd in unity
Tdd in unityTdd in unity
Tdd in unity
Eric Smith
 
TDD - Agile
TDD - Agile TDD - Agile
TDD - Agile
harinderpisces
 
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
Zohirul Alam Tiemoon
 
Test Driven Development (TDD)
Test Driven Development (TDD)Test Driven Development (TDD)
Test Driven Development (TDD)
David Ehringer
 
Java script tutorial by example
Java script tutorial by exampleJava script tutorial by example
Java script tutorial by example
myzyzy
 
Javascript TDD by example
Javascript TDD by exampleJavascript TDD by example
Javascript TDD by example
Eric Mignot
 
Mock driven development using .NET
Mock driven development using .NETMock driven development using .NET
Mock driven development using .NET
Puneet Ghanshani
 
Unit Testing and Test Driven Development in Unity3D
Unit Testing and Test Driven Development in Unity3DUnit Testing and Test Driven Development in Unity3D
Unit Testing and Test Driven Development in Unity3D
Andrew Fray
 
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
Zohirul Alam Tiemoon
 
Test Driven Development (TDD)
Test Driven Development (TDD)Test Driven Development (TDD)
Test Driven Development (TDD)
David Ehringer
 
Ad

Similar to Tdd,Ioc (20)

GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
GlobalLogic Ukraine
 
CQRS and Event Sourcing
CQRS and Event SourcingCQRS and Event Sourcing
CQRS and Event Sourcing
Sergey Seletsky
 
Elements of DDD with ASP.NET MVC & Entity Framework Code First
Elements of DDD with ASP.NET MVC & Entity Framework Code FirstElements of DDD with ASP.NET MVC & Entity Framework Code First
Elements of DDD with ASP.NET MVC & Entity Framework Code First
Enea Gabriel
 
Apex Enterprise Patterns: Building Strong Foundations
Apex Enterprise Patterns: Building Strong FoundationsApex Enterprise Patterns: Building Strong Foundations
Apex Enterprise Patterns: Building Strong Foundations
Salesforce Developers
 
Use Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDEUse Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDE
Benjamin Cabé
 
.NET Portfolio
.NET Portfolio.NET Portfolio
.NET Portfolio
mwillmer
 
Poco Es Mucho: WCF, EF, and Class Design
Poco Es Mucho: WCF, EF, and Class DesignPoco Es Mucho: WCF, EF, and Class Design
Poco Es Mucho: WCF, EF, and Class Design
James Phillips
 
Ef Poco And Unit Testing
Ef Poco And Unit TestingEf Poco And Unit Testing
Ef Poco And Unit Testing
James Phillips
 
Coding Naked 2023
Coding Naked 2023Coding Naked 2023
Coding Naked 2023
Caleb Jenkins
 
Expanding your impact with programmability in the data center
Expanding your impact with programmability in the data centerExpanding your impact with programmability in the data center
Expanding your impact with programmability in the data center
Cisco Canada
 
Behaviour Driven Development V 0.1
Behaviour Driven Development V 0.1Behaviour Driven Development V 0.1
Behaviour Driven Development V 0.1
willmation
 
Whidbey old
Whidbey old Whidbey old
Whidbey old
grenaud
 
Clean Code Part II - Dependency Injection at SoCal Code Camp
Clean Code Part II - Dependency Injection at SoCal Code CampClean Code Part II - Dependency Injection at SoCal Code Camp
Clean Code Part II - Dependency Injection at SoCal Code Camp
Theo Jungeblut
 
Clean Architecture @ Taxibeat
Clean Architecture @ TaxibeatClean Architecture @ Taxibeat
Clean Architecture @ Taxibeat
Michael Bakogiannis
 
Framework engineering JCO 2011
Framework engineering JCO 2011Framework engineering JCO 2011
Framework engineering JCO 2011
YoungSu Son
 
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...
Sparkhound Inc.
 
Divide and Conquer – Microservices with Node.js
Divide and Conquer – Microservices with Node.jsDivide and Conquer – Microservices with Node.js
Divide and Conquer – Microservices with Node.js
Sebastian Springer
 
DDD, CQRS and testing with ASP.Net MVC
DDD, CQRS and testing with ASP.Net MVCDDD, CQRS and testing with ASP.Net MVC
DDD, CQRS and testing with ASP.Net MVC
Andy Butland
 
C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2
Hammad Rajjoub
 
C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2
Hammad Rajjoub
 
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
GlobalLogic Ukraine
 
Elements of DDD with ASP.NET MVC & Entity Framework Code First
Elements of DDD with ASP.NET MVC & Entity Framework Code FirstElements of DDD with ASP.NET MVC & Entity Framework Code First
Elements of DDD with ASP.NET MVC & Entity Framework Code First
Enea Gabriel
 
Apex Enterprise Patterns: Building Strong Foundations
Apex Enterprise Patterns: Building Strong FoundationsApex Enterprise Patterns: Building Strong Foundations
Apex Enterprise Patterns: Building Strong Foundations
Salesforce Developers
 
Use Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDEUse Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDE
Benjamin Cabé
 
.NET Portfolio
.NET Portfolio.NET Portfolio
.NET Portfolio
mwillmer
 
Poco Es Mucho: WCF, EF, and Class Design
Poco Es Mucho: WCF, EF, and Class DesignPoco Es Mucho: WCF, EF, and Class Design
Poco Es Mucho: WCF, EF, and Class Design
James Phillips
 
Ef Poco And Unit Testing
Ef Poco And Unit TestingEf Poco And Unit Testing
Ef Poco And Unit Testing
James Phillips
 
Expanding your impact with programmability in the data center
Expanding your impact with programmability in the data centerExpanding your impact with programmability in the data center
Expanding your impact with programmability in the data center
Cisco Canada
 
Behaviour Driven Development V 0.1
Behaviour Driven Development V 0.1Behaviour Driven Development V 0.1
Behaviour Driven Development V 0.1
willmation
 
Whidbey old
Whidbey old Whidbey old
Whidbey old
grenaud
 
Clean Code Part II - Dependency Injection at SoCal Code Camp
Clean Code Part II - Dependency Injection at SoCal Code CampClean Code Part II - Dependency Injection at SoCal Code Camp
Clean Code Part II - Dependency Injection at SoCal Code Camp
Theo Jungeblut
 
Framework engineering JCO 2011
Framework engineering JCO 2011Framework engineering JCO 2011
Framework engineering JCO 2011
YoungSu Son
 
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...
Sparkhound Inc.
 
Divide and Conquer – Microservices with Node.js
Divide and Conquer – Microservices with Node.jsDivide and Conquer – Microservices with Node.js
Divide and Conquer – Microservices with Node.js
Sebastian Springer
 
DDD, CQRS and testing with ASP.Net MVC
DDD, CQRS and testing with ASP.Net MVCDDD, CQRS and testing with ASP.Net MVC
DDD, CQRS and testing with ASP.Net MVC
Andy Butland
 
C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2
Hammad Rajjoub
 
C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2C:\Fakepath\Combating Software Entropy 2
C:\Fakepath\Combating Software Entropy 2
Hammad Rajjoub
 
Ad

Recently uploaded (20)

Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Network Security. Different aspects of Network Security.
Network Security. Different aspects of Network Security.Network Security. Different aspects of Network Security.
Network Security. Different aspects of Network Security.
gregtap1
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
"PHP and MySQL CRUD Operations for Student Management System"
"PHP and MySQL CRUD Operations for Student Management System""PHP and MySQL CRUD Operations for Student Management System"
"PHP and MySQL CRUD Operations for Student Management System"
Jainul Musani
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Datastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptxDatastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptx
kaleeswaric3
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Automation Hour 1/28/2022: Capture User Feedback from Anywhere
Automation Hour 1/28/2022: Capture User Feedback from AnywhereAutomation Hour 1/28/2022: Capture User Feedback from Anywhere
Automation Hour 1/28/2022: Capture User Feedback from Anywhere
Lynda Kane
 
Buckeye Dreamin' 2023: De-fogging Debug Logs
Buckeye Dreamin' 2023: De-fogging Debug LogsBuckeye Dreamin' 2023: De-fogging Debug Logs
Buckeye Dreamin' 2023: De-fogging Debug Logs
Lynda Kane
 
Automation Dreamin': Capture User Feedback From Anywhere
Automation Dreamin': Capture User Feedback From AnywhereAutomation Dreamin': Capture User Feedback From Anywhere
Automation Dreamin': Capture User Feedback From Anywhere
Lynda Kane
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Hands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordDataHands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordData
Lynda Kane
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Network Security. Different aspects of Network Security.
Network Security. Different aspects of Network Security.Network Security. Different aspects of Network Security.
Network Security. Different aspects of Network Security.
gregtap1
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
"PHP and MySQL CRUD Operations for Student Management System"
"PHP and MySQL CRUD Operations for Student Management System""PHP and MySQL CRUD Operations for Student Management System"
"PHP and MySQL CRUD Operations for Student Management System"
Jainul Musani
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Datastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptxDatastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptx
kaleeswaric3
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Automation Hour 1/28/2022: Capture User Feedback from Anywhere
Automation Hour 1/28/2022: Capture User Feedback from AnywhereAutomation Hour 1/28/2022: Capture User Feedback from Anywhere
Automation Hour 1/28/2022: Capture User Feedback from Anywhere
Lynda Kane
 
Buckeye Dreamin' 2023: De-fogging Debug Logs
Buckeye Dreamin' 2023: De-fogging Debug LogsBuckeye Dreamin' 2023: De-fogging Debug Logs
Buckeye Dreamin' 2023: De-fogging Debug Logs
Lynda Kane
 
Automation Dreamin': Capture User Feedback From Anywhere
Automation Dreamin': Capture User Feedback From AnywhereAutomation Dreamin': Capture User Feedback From Anywhere
Automation Dreamin': Capture User Feedback From Anywhere
Lynda Kane
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Hands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordDataHands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordData
Lynda Kane
 

Tdd,Ioc

  • 1. Introduction to TDD and CI Antonio Radesca
  • 2. Test Driven Development Defined by Kent Beck in Test Driven Development By Examples Rules Never write a single line of code unless you have a failing automated test Eliminate duplication
  • 3. Practices and Tool Nunit,MBUnit... Resharper (Refactoring)‏ Gallio suite
  • 4. Refactoring Process of rewriting code for improve readability, semplification, performances and design “ Refactoring” by Martin Fowler There you can find more informations and patterns Automated from some tools: VS refactoring, Resharper,Visual Assist...
  • 5. Some Examples namespace ERP.UnitTests.Repository.NHibernate { [ TestFixture ] public class FixtureNHibernateClientRepository { [ SetUp ] public void SetupMethod()‏ { TestUtilities obj= new TestUtilities (); obj.ExecuteQuery( &quot;DELETE FROM CLIENTS&quot; ); obj.ExecuteQuery( @&quot;DBCC CHECKIDENT(Clients,RESEED,0)&quot; ); } [ Test ] public void SaveClient()‏ { Client obj= new Client (); obj.NameSurname = &quot;name&quot; ; obj.City = &quot;city&quot; ; obj.Address = &quot;Address&quot; ; ERP.Repository.NHibernate. ClientRepository objRep= new ClientRepository (); objRep.Save(obj); objRep.Commit(); Client tmp = objRep.Load(1); Assert .AreEqual( true , CompareClients(tmp, obj)); } private bool CompareClients( Client tmp, Client obj)‏ { if (tmp.ID == obj.ID && obj.City == tmp.City && tmp.NameSurname == obj.NameSurname && tmp.Address == obj.Address)‏ return true ; return false ; } } }
  • 7. BDD:Practices A SubjectMatterExpert (typically a business user) works with a BusinessAnalyst to identify a business requirement. This is expressed as a story using the following template As a Role I request a Feature To gain a Benefit The speaker, who holds the Role, is the person who will gain the Benefit from the requested Feature.
  • 8. Mocks Do you need to test something that is related to other components?
  • 9. Rhino Mocks Created by Ayende Simple, documented and updated CODE...
  • 11. Continuous Integration Extende and improve build automation Prevent from integration problems Examples:CruiseControl.NET,TFS,Draco.NET...
  • 12. CI:Practices Maintain a Single Source Repository Automate the Build Make Your Build Self-Testing Everyone Commits Every Day Every Commit Should Build the Mainline on an Integration Machine Keep the Build Fast Test in a Clone of the Production Environment Make it easy to get the latest deliverables Everyone can see the results of the latest build Automate Deployment
  • 15. Inversion Of Control Good software: High coesion,low coupled
  • 16. What is IOC From Wikipedia: abstract principle describing an aspect of some software architecture designs in which the flow of control of a system is inverted in comparison to the traditional architecture of software libraries. Instead of specifying a sequence of decisions and procedures to occur during the lifetime of a process, the user of an IoC framework writes the desired responses linked to particular events or data requests. External entities then take control over the precise calling order and additional maintenance that are to be carried out to execute the process.
  • 18. IOC
  • 19. Hollywood Principle Don't call us, we'll call you. High cohesion and low coupling
  • 20. Dependency Injection Dependency Injection (DI) in computer programming refers to the process of supplying an external dependency to a software component. It is a specific form of inversion of control where the concern being inverted is the process of obtaining the needed dependency. The object simply provides a property that can hold a reference to that type of service; and when the object is created a reference to an implementation of that type of service will automatically be injected into that property - by an external mechanism. See Martin Fowler for types...
  • 21. IOC Framework for .NET Managed Extensibility Framework Autofac Castle MicroKernel/Windsor ObjectBuilder PicoContainer.NET Puzzle.NFactory Spring.NET StructureMap Ninject Unity NauckIT.MicroKernel
  • 22. Example using System; using System.Collections.Generic; using System.Linq; using System.Text; using Castle.Core.Resource; using Castle.Windsor; using Castle.Windsor.Configuration.Interpreters; using Microsoft.Practices.Unity; namespace ERP.Services { public interface IServicesFactory { T GetService<T>(); } public class ServicesFactory : IServicesFactory { private static IWindsorContainer container; static ServicesFactory()‏ { container = new WindsorContainer ( new XmlInterpreter ( new ConfigResource ( &quot;notification&quot; ))); } public T GetService<T>()‏ { return container.GetService<T>(); } } }
  • 24. What is an aspect? Paradigm programming based on crosscuts concepts Examples:Logging,Transactions,Caching... AOP Containers:Spring.NET,Castle Windsor,Unity Application Block...
  • 25. Some Examples using System; using System.Collections.Generic; using System.Linq; using System.Text; using Castle.DynamicProxy; using Utils; namespace ERP.Services.AOP { //Classe che gestisce il logging instanziando oggetti generici public class LoggingManager <T> { public void Log<T>( string method)‏ { ProxyGenerator generator = new ProxyGenerator (); T logger = generator.CreateClassProxy<T>( new LoggingInterceptor ()); ReflectionHelper .CallMethod(logger,method); } } }