SlideShare a Scribd company logo
1 of 68
Designing Testable Code
by Bjorn Schultheiss




                       Topic                     Presenter
                       Designing Testable Code   Bjorn Schultheiss
Who am I?
Bjorn Schultheiss
Developer
Adslot


Front end developer
Flash, Flex and now even some Javascript
Large projects including http://www.adchamp.com




                      Topic                       Presenter
                     Designing Testable Code      Bjorn Schultheiss
Recent thoughts about Flash




       Topic                     Presenter
       Designing Testable Code   Bjorn Schultheiss
Find your passion
       Topic
       Designing Testable Code
                                 Presenter
                                 Bjorn Schultheiss
Testable code you say
This presentation will cover


  • How to look at OO
  • Static methods and Global State
  • Separation of object construction and logic
  • Constructor Injection vs Setter Injection
  • Presentation Model

                        Topic                     Presenter
                        Designing Testable Code   Bjorn Schultheiss
Sorry I’m busy dude
       Topic
       Designing Testable Code
                                 Presenter
                                 Bjorn Schultheiss
And why would I be interested?
This presentation is targeted at


  • Any developer creating heavy client side applications
  • Focused specifically on Flex but the same principals
       apply to other web languages and frameworks

  • you love that feeling from watching a test pass


                        Topic                     Presenter
                        Designing Testable Code   Bjorn Schultheiss
Tell me about Flex Unit
This talk is not about Flexunit


  • Flex developer’s best friend
  • Created by the community
  • Endorsed by Adobe (integrated in FB)
  • Easy to get started with


                         Topic                     Presenter
                         Designing Testable Code   Bjorn Schultheiss
Topic                     Presenter
Designing Testable Code   Bjorn Schultheiss
What are unit tests?




        Topic                     Presenter
        Designing Testable Code   Bjorn Schultheiss
I knew you cowboys were here
       Topic
       Designing Testable Code
                                 Presenter
                                 Bjorn Schultheiss
• They are written by software engineers, not test
  engineers.

• They are better written as you code, not after you’ve
  finished




               Topic                     Presenter
               Designing Testable Code   Bjorn Schultheiss
The only good excuse not to be writing them is because
you don’t know how.




               Topic                     Presenter
               Designing Testable Code   Bjorn Schultheiss
So what do i need to know?




       Topic                     Presenter
       Designing Testable Code   Bjorn Schultheiss
How to think about OO

• OO is about the relationship between data and
  code

• data represents the state of an object
• code modifies that state


              Topic                     Presenter
              Designing Testable Code   Bjorn Schultheiss
Procedural

	   public class ImageEditor
	   {
	   	
	   	 public function crop(image:Bitmap, size:Rectangle):Bitmap
	   	 {
	   	 	 // do something
	   	 }




                     Topic                         Presenter
                     Designing Testable Code       Bjorn Schultheiss
Better
 public   class ImageEditor
 	 {
 	 	      private var _image:Bitmap;
 	 	
 	 	      public function ImageEditor(image:Bitmap) {
 	 	      	 _image = image;
 	 	      }
 	 	
 	 	      public function crop(size:Rectangle):void
 	 	      {
 	 	      	 // do something
 	 	      }
 	 }




                      Topic                             Presenter
                     Designing Testable Code          Bjorn Schultheiss
Global State

• Object state is subject to garbage collection
• Global state is subject to life of the session




              Topic                     Presenter
              Designing Testable Code   Bjorn Schultheiss
Global State
a = new X() -->




                  Topic                     Presenter
                  Designing Testable Code   Bjorn Schultheiss
Global State
                                 Y
a = new X() -->                                         Z
                          X
                                            Q




                  Topic                     Presenter
                  Designing Testable Code   Bjorn Schultheiss
Global State
                                 Y
a = new X() -->                                         Z
                          X
                                            Q



b = new X() -->




                  Topic                     Presenter
                  Designing Testable Code   Bjorn Schultheiss
Global State
                                 Y
a = new X() -->                                         Z
                          X
                                            Q



                                 Y
b = new X() -->                                          Z
                          X
                                            Q

                  Topic                     Presenter
                  Designing Testable Code   Bjorn Schultheiss
Global State
                                  Y
a = new X() -->                                          Z
a.doSomething();           X
                                             Q



                                  Y
b = new X() -->                                           Z
                           X
                                             Q

                   Topic                     Presenter
                   Designing Testable Code   Bjorn Schultheiss
Global State
                                  Y
a = new X() -->                                          Z
a.doSomething();           X
                                             Q



                                  Y
b = new X() -->                                           Z
b.doSomething();           X
                                             Q

                   Topic                     Presenter
                   Designing Testable Code   Bjorn Schultheiss
Global State
                                  Y
a = new X() -->                                          Z
a.doSomething();           X
                                             Q
a == b
                                  Y
b = new X() -->                                           Z
b.doSomething();           X
                                             Q

                   Topic                     Presenter
                   Designing Testable Code   Bjorn Schultheiss
Global State
                                  Y
a = new X() -->                                          Z
a.doSomething();           X
                                             Q
                                                                 GS
a == b
                                  Y
b = new X() -->                                           Z
b.doSomething();           X
                                             Q

                   Topic                     Presenter
                   Designing Testable Code   Bjorn Schultheiss
Global State

• Inconsistent results
• Order of tests matter
• Something the tester doesn’t control



             Topic                     Presenter
             Designing Testable Code   Bjorn Schultheiss
Singletons




       Topic                     Presenter
       Designing Testable Code   Bjorn Schultheiss
Singleton’s are pathological liars
         Topic
         Designing Testable Code
                                   Presenter
                                   Bjorn Schultheiss
Singletons
• Singletons use global state




             Topic                     Presenter
             Designing Testable Code   Bjorn Schultheiss
package
{
	   public class AppSettings
	   {
	   	   private static const _instance:AppSettings = new AppSettings(Lock);
	   	
	   	   private var _state1:Object;
	   	   private var _state2:Object;
	   	   private var _state3:Object;
	   	
	   	   public static function get instance():AppSettings {
	   	   	   return _instance;
	   	   }
	   	
	   	   public function AppSettings(lock:Class) {
	   	   	   if (lock!=Lock) throw new Error("cannot unlock");
	   	   }
	   }
}

internal class Lock {}




                 Topic                              Presenter
                 Designing Testable Code            Bjorn Schultheiss
Singletons
• Singletons use global state
• the test doesn’t control the instantion of the
   process




              Topic                     Presenter
              Designing Testable Code   Bjorn Schultheiss
package
{
	   public class AppSettings
	   {
	   	   private static const _instance:AppSettings = new AppSettings(Lock);
	   	
	   	   private var _state1:Object;
	   	   private var _state2:Object;
	   	   private var _state3:Object;
	   	
	   	   public static function get instance():AppSettings {
	   	   	   return _instance;
	   	   }
	   	
	   	   public function AppSettings(lock:Class) {
	   	   	   if (lock!=Lock) throw new Error("cannot unlock");
	   	   }
	   }
}

internal class Lock {}




                 Topic                              Presenter
                 Designing Testable Code            Bjorn Schultheiss
Singletons
• Singletons use global state
• the test doesn’t control the instantion of the
   process

• secret collaborators



              Topic                     Presenter
              Designing Testable Code   Bjorn Schultheiss
public class CreditCard
	   {
	   	   private var _gateway:PaymentGateway;
	   	
	   	   public function CreditCard()
	   	   {
	   	   	   gateway = ServiceLocator.getInstance().gateway;
	   	   }
	   	
	   	   public function chargeCard(value:Number):void
	   	   {
	   	   	   gateway.performTransaction(value);
	   	   }
	   }




	   var cc:CreditCard = new CreditCard();
	   cc.chargeCard(10);




                      Topic                              Presenter
                     Designing Testable Code             Bjorn Schultheiss
Singletons
• Singletons use global state
• the test doesn’t control the instantion of the
   process

• secret collaborators
• you may know the dependencies, but anyone that
   comes after you is baffled!



              Topic                     Presenter
              Designing Testable Code   Bjorn Schultheiss
Law of Demeter

Object.getSomething.theProperty




              Topic                     Presenter
              Designing Testable Code   Bjorn Schultheiss
Law of Demeter

Object.getSomething.theProperty




              Topic                     Presenter
              Designing Testable Code   Bjorn Schultheiss
Law of Demeter

Object.getSomething.theProperty

something.theProperty




              Topic                     Presenter
              Designing Testable Code   Bjorn Schultheiss
Locator in action
 class   House {
 	 	
 	 	
 	 	
 	 	
 	 	     public function House(locator:Locator) {
 	 	     	
 	 	     	 // what needs to be mocked in test?
 	 	     	
 	 	     }
 	 }




                     Topic                          Presenter
                     Designing Testable Code        Bjorn Schultheiss
Use revealed
 class   House {
 	 	      private var _door:Door;
 	 	      private var _roof:Roof;
 	 	      private var _window:Window
 	 	
 	 	     public function House(locator:Locator) {          API gave us
 	 	     	 _door = locator.getDoor();
 	 	     	 _roof = locator.getRoof();                        no help
 	 	     	 _window = locator.getWindow();
 	 	     }
 	 }




                      Topic                         Presenter
                      Designing Testable Code       Bjorn Schultheiss
An API that helps
	   class House {
	   	 private var _door:Door;
	   	 private var _roof:Roof;
	   	 private var _window:Window
	   	
	   	 public function House(door:Door, roof:Roof, window:Window) {
	   	 	 _door = door;
	   	 	 _roof = roof;
	   	 	 _window = window;
	   	 }
	   }




                      Topic                         Presenter
                     Designing Testable Code        Bjorn Schultheiss
Similar Anti-Patterns
I didn’t ask for that!!


  • aka Locator
  • aka Context
  • aka Manager
  • Hides true dependencies
  • Breaks law of demeter

                          Topic                     Presenter
                          Designing Testable Code   Bjorn Schultheiss
Constructor vs Setter injection

• An order of instantiation




              Topic                     Presenter
              Designing Testable Code   Bjorn Schultheiss
Setter example
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
	    	      xmlns:s="library://ns.adobe.com/flex/spark">
	    <fx:Script>
	    	    <![CDATA[
	    	    	     import mx.collections.ArrayCollection;
	    	    	     import mx.collections.IList;
	    	    	     import mx.rpc.AsyncToken;
	    	    	
	    	    	     public var userService:Service;
	    	    	
	    	    	     public function findUsers():void {
	    	    	     	    userService.findAll();
	    	    	     	    userService.addEventListener("onResult", onResult);
	    	    	     }
	    	    	
	    	    	     public function onResult(result:Object):void {
	    	    	     	    users.dataprovider = new ArrayCollection(result);
	    	    	     }
	    	    ]]>
	    </fx:Script>
	    <s:Button label="find all users" click="findUsers();" />
	    <s:List id="users" />
</s:Group>




                            Topic                                          Presenter
                            Designing Testable Code                        Bjorn Schultheiss
Constructor example
 public class ShowUserModel
 	    {
 	    	   [Bindable]
 	    	   public var users:IList;
 	    	   private var _service:Service;
 	    	
 	    	   public function ShowUserModel(service:Service)
 	    	   {
 	    	   	    _service = service;
 	    	   	    _service.addEventListener("onResult", onResult);
 	    	   }
 	    	
 	    	   public function findUsers():void
 	    	   {
 	    	   	    _service.findAll();
 	    	   }
 	    	
 	    	   private function onResult(result:Object):void {
 	    	   	    users = new ArrayCollection(result);
 	    	   }
 	    }




                           Topic                                  Presenter
                           Designing Testable Code                Bjorn Schultheiss
Instantiation example
	   	   [Test]
	   	   public function testShowUsersComponent():void
	   	   {
	   	   	   var service:Service = new Service("Users");
	   	   	   var component:ShowUsersComponent = new ShowUsersComponent();
	   	   	   component.service = service;
	   	   	   component.findUsers();
	   	   }
	   	

	   	   [Test]
	   	   public function testShowUsersModel():void
	   	   {
	   	   	   var service:Service = new Service("Users");
	   	   	   var model:ShowUsersModel = new ShowUsersModel(service);
	   	   	   model.findUsers();
	   	   }




                                Topic                                  Presenter
                                Designing Testable Code                Bjorn Schultheiss
How does this relate to unit
testing?




        Topic                     Presenter
        Designing Testable Code   Bjorn Schultheiss
How does this relate to unit
testing?

      Unit testing as the name
 implies you test a Class (unit)
                     in isolation

        Topic                     Presenter
        Designing Testable Code   Bjorn Schultheiss
If your class mixes Object
construction and logic you will
never be able to achieve
isolation


        Topic                     Presenter
        Designing Testable Code   Bjorn Schultheiss
In order to unit test you
    need to separate your
object graph construction
      from the logic into 2
          different classes

   Topic                     Presenter
   Designing Testable Code   Bjorn Schultheiss
The end goal is to have classes with either logic or “new”
operators




                Topic                     Presenter
                Designing Testable Code   Bjorn Schultheiss
Construction and logic mixed
 	   public class House
 	   {
 	   	   private var _kitchen:Kitchen = new Kitchen();
 	   	   private var _isLocked:Boolean;
 	   	
 	   	   public function get isLocked():Boolean {
 	   	   	   return _isLocked;
 	   	   }
 	   	
 	   	   public function lock() {
 	   	   	   _kitchen.lock();
 	   	   	   _isLocked = true;
 	   	   }
 	   }




                       Topic                             Presenter
                       Designing Testable Code           Bjorn Schultheiss
Injection example
 public class House
 	   {
 	   	    private var _kitchen:Kitchen;
 	   	    private var _isLocked:Boolean;
 	   	
 	   	    public function House(kitchen:Kitchen) {
 	   	    	   _kitchen = kitchen;
 	   	    }
 	   	
 	   	    public function get isLocked():Boolean {
 	   	    	   return _isLocked;
 	   	    }
 	   	
 	   	    public function lock() {
 	   	    	   _kitchen.lock();
 	   	    	   _isLocked = true;
 	   	    }
 	   }




                        Topic                        Presenter
                        Designing Testable Code      Bjorn Schultheiss
Construction example

  function build():House {
  	 	 	 return new House(new Kitchen(
  	 	 	 	 new Sink(),
  	 	 	 	 new Dishwasher(),
  	 	 	 	 new Refrigerator())
  	 	 	 );
  }




                 Topic                    Presenter
                Designing Testable Code   Bjorn Schultheiss
lets look at writing a unit test




         Topic                     Presenter
         Designing Testable Code   Bjorn Schultheiss
Writing a unit test
to test a method first you need to instantiate an object


  • Specifically the class or component to be tested
  • Any collaborators (real or mock).




                        Topic                             Presenter
                        Designing Testable Code           Bjorn Schultheiss
[Test]
	   	   public function testHouse():void
	   	   {
	   	   	 var kitchen:Kitchen = new Kitchen();
	   	   	 var house:House = new House(kitchen);
	   	   	 house.testMethod();
	   	   }




                    Topic                         Presenter
                    Designing Testable Code       Bjorn Schultheiss
Testing UI Components




       Topic                     Presenter
       Designing Testable Code   Bjorn Schultheiss
Spare me
       Topic
       Designing Testable Code
                                 Presenter
                                 Bjorn Schultheiss
Testing UI Components
Possible but generally a pain, why?


  • test a style is applied
  • mimic user interaction
  • logic is is mixed with view



                       Topic                     Presenter
                       Designing Testable Code   Bjorn Schultheiss
[Before(async,ui)]
public function setUp() : void
{
	   myButton = new MyButton();
	   Async.proceedOnEvent( this, myButton, FlexEvent.CREATION_COMPLETE, 100 );
	   UIImpersonator.addChild( myButton );
}
 
 
[Test(async,ui)]
public function myButton_myStyle_defaultValue() : void
{
	   Assert.assertEquals( myButton.getStyle( "myStyle" ), "expectedDefaultValue" );
}




                     Topic                              Presenter
                     Designing Testable Code            Bjorn Schultheiss
UI Codefendants
• UIImpersonator
• invalidationModel
• [Async] proceedOnEvent()
• displayList hierarchy



            Topic                     Presenter
            Designing Testable Code   Bjorn Schultheiss
Presentation Models
http://martinfowler.com/eaaDev/PresentationModel.html
Represent the state and behaviour of the presentation independently of the GUI controls
used in the interface


  • uses Binding to interact with view
  • also handles events from view
  • a pattern used in popular frameworks
  • great for unit testing

                       Topic                           Presenter
                       Designing Testable Code         Bjorn Schultheiss
Presentation Model example
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009">
                                                      package presentation
	    <fx:Script>
                                                      {
	    	    <![CDATA[
                                                      	    [Bindable]
	    	    	    import presentation.HelloWorldModel;
                                                      	    public class HelloWorldModel
	    	    	    [Bindable]
                                                      	    {
	    	    	    public var model:HelloWorldModel;
                                                      	    	    public var label:String = "Hello";
	    	    ]]>
                                                      	    	
	    </fx:Script>
                                                      	    	    public function clickHandler():void
	    <s:Label text="{ model.label }"
                                                      	    	    {
click="model.clickHandler();" />
                                                      	    	    	    trace("Is it me your looking for?");
</s:Group>
                                                      	    	    }
                                                      	    }
                                                      }




                             Topic                             Presenter
                            Designing Testable Code            Bjorn Schultheiss
Business logic and PM’s
Leave me out of it!


  • Presentation Models and Views have a 1 to 1
      relationship

  • Business logic is best separated from PM’s
  • PM’s know about Business/Application classes,
      those classes know nothing about PM’s



                      Topic                     Presenter
                      Designing Testable Code   Bjorn Schultheiss
Well on your way
        Topic
        Designing Testable Code
                                  Presenter
                                  Bjorn Schultheiss
Thanks, questions?




       Topic                     Presenter
       Designing Testable Code   Bjorn Schultheiss

More Related Content

Recently uploaded

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 

Recently uploaded (20)

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Testable code

  • 1. Designing Testable Code by Bjorn Schultheiss Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 2. Who am I? Bjorn Schultheiss Developer Adslot Front end developer Flash, Flex and now even some Javascript Large projects including http://www.adchamp.com Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 3. Recent thoughts about Flash Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 4. Find your passion Topic Designing Testable Code Presenter Bjorn Schultheiss
  • 5. Testable code you say This presentation will cover • How to look at OO • Static methods and Global State • Separation of object construction and logic • Constructor Injection vs Setter Injection • Presentation Model Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 6. Sorry I’m busy dude Topic Designing Testable Code Presenter Bjorn Schultheiss
  • 7. And why would I be interested? This presentation is targeted at • Any developer creating heavy client side applications • Focused specifically on Flex but the same principals apply to other web languages and frameworks • you love that feeling from watching a test pass Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 8. Tell me about Flex Unit This talk is not about Flexunit • Flex developer’s best friend • Created by the community • Endorsed by Adobe (integrated in FB) • Easy to get started with Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 9. Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 10. What are unit tests? Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 11. I knew you cowboys were here Topic Designing Testable Code Presenter Bjorn Schultheiss
  • 12. • They are written by software engineers, not test engineers. • They are better written as you code, not after you’ve finished Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 13. The only good excuse not to be writing them is because you don’t know how. Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 14. So what do i need to know? Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 15. How to think about OO • OO is about the relationship between data and code • data represents the state of an object • code modifies that state Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 16. Procedural public class ImageEditor { public function crop(image:Bitmap, size:Rectangle):Bitmap { // do something } Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 17. Better public class ImageEditor { private var _image:Bitmap; public function ImageEditor(image:Bitmap) { _image = image; } public function crop(size:Rectangle):void { // do something } } Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 18. Global State • Object state is subject to garbage collection • Global state is subject to life of the session Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 19. Global State a = new X() --> Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 20. Global State Y a = new X() --> Z X Q Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 21. Global State Y a = new X() --> Z X Q b = new X() --> Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 22. Global State Y a = new X() --> Z X Q Y b = new X() --> Z X Q Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 23. Global State Y a = new X() --> Z a.doSomething(); X Q Y b = new X() --> Z X Q Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 24. Global State Y a = new X() --> Z a.doSomething(); X Q Y b = new X() --> Z b.doSomething(); X Q Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 25. Global State Y a = new X() --> Z a.doSomething(); X Q a == b Y b = new X() --> Z b.doSomething(); X Q Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 26. Global State Y a = new X() --> Z a.doSomething(); X Q GS a == b Y b = new X() --> Z b.doSomething(); X Q Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 27. Global State • Inconsistent results • Order of tests matter • Something the tester doesn’t control Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 28. Singletons Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 29. Singleton’s are pathological liars Topic Designing Testable Code Presenter Bjorn Schultheiss
  • 30. Singletons • Singletons use global state Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 31. package { public class AppSettings { private static const _instance:AppSettings = new AppSettings(Lock); private var _state1:Object; private var _state2:Object; private var _state3:Object; public static function get instance():AppSettings { return _instance; } public function AppSettings(lock:Class) { if (lock!=Lock) throw new Error("cannot unlock"); } } } internal class Lock {} Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 32. Singletons • Singletons use global state • the test doesn’t control the instantion of the process Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 33. package { public class AppSettings { private static const _instance:AppSettings = new AppSettings(Lock); private var _state1:Object; private var _state2:Object; private var _state3:Object; public static function get instance():AppSettings { return _instance; } public function AppSettings(lock:Class) { if (lock!=Lock) throw new Error("cannot unlock"); } } } internal class Lock {} Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 34. Singletons • Singletons use global state • the test doesn’t control the instantion of the process • secret collaborators Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 35. public class CreditCard { private var _gateway:PaymentGateway; public function CreditCard() { gateway = ServiceLocator.getInstance().gateway; } public function chargeCard(value:Number):void { gateway.performTransaction(value); } } var cc:CreditCard = new CreditCard(); cc.chargeCard(10); Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 36. Singletons • Singletons use global state • the test doesn’t control the instantion of the process • secret collaborators • you may know the dependencies, but anyone that comes after you is baffled! Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 37. Law of Demeter Object.getSomething.theProperty Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 38. Law of Demeter Object.getSomething.theProperty Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 39. Law of Demeter Object.getSomething.theProperty something.theProperty Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 40. Locator in action class House { public function House(locator:Locator) { // what needs to be mocked in test? } } Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 41. Use revealed class House { private var _door:Door; private var _roof:Roof; private var _window:Window public function House(locator:Locator) { API gave us _door = locator.getDoor(); _roof = locator.getRoof(); no help _window = locator.getWindow(); } } Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 42. An API that helps class House { private var _door:Door; private var _roof:Roof; private var _window:Window public function House(door:Door, roof:Roof, window:Window) { _door = door; _roof = roof; _window = window; } } Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 43. Similar Anti-Patterns I didn’t ask for that!! • aka Locator • aka Context • aka Manager • Hides true dependencies • Breaks law of demeter Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 44. Constructor vs Setter injection • An order of instantiation Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 45. Setter example <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"> <fx:Script> <![CDATA[ import mx.collections.ArrayCollection; import mx.collections.IList; import mx.rpc.AsyncToken; public var userService:Service; public function findUsers():void { userService.findAll(); userService.addEventListener("onResult", onResult); } public function onResult(result:Object):void { users.dataprovider = new ArrayCollection(result); } ]]> </fx:Script> <s:Button label="find all users" click="findUsers();" /> <s:List id="users" /> </s:Group> Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 46. Constructor example public class ShowUserModel { [Bindable] public var users:IList; private var _service:Service; public function ShowUserModel(service:Service) { _service = service; _service.addEventListener("onResult", onResult); } public function findUsers():void { _service.findAll(); } private function onResult(result:Object):void { users = new ArrayCollection(result); } } Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 47. Instantiation example [Test] public function testShowUsersComponent():void { var service:Service = new Service("Users"); var component:ShowUsersComponent = new ShowUsersComponent(); component.service = service; component.findUsers(); } [Test] public function testShowUsersModel():void { var service:Service = new Service("Users"); var model:ShowUsersModel = new ShowUsersModel(service); model.findUsers(); } Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 48. How does this relate to unit testing? Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 49. How does this relate to unit testing? Unit testing as the name implies you test a Class (unit) in isolation Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 50. If your class mixes Object construction and logic you will never be able to achieve isolation Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 51. In order to unit test you need to separate your object graph construction from the logic into 2 different classes Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 52. The end goal is to have classes with either logic or “new” operators Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 53. Construction and logic mixed public class House { private var _kitchen:Kitchen = new Kitchen(); private var _isLocked:Boolean; public function get isLocked():Boolean { return _isLocked; } public function lock() { _kitchen.lock(); _isLocked = true; } } Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 54. Injection example public class House { private var _kitchen:Kitchen; private var _isLocked:Boolean; public function House(kitchen:Kitchen) { _kitchen = kitchen; } public function get isLocked():Boolean { return _isLocked; } public function lock() { _kitchen.lock(); _isLocked = true; } } Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 55. Construction example function build():House { return new House(new Kitchen( new Sink(), new Dishwasher(), new Refrigerator()) ); } Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 56. lets look at writing a unit test Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 57. Writing a unit test to test a method first you need to instantiate an object • Specifically the class or component to be tested • Any collaborators (real or mock). Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 58. [Test] public function testHouse():void { var kitchen:Kitchen = new Kitchen(); var house:House = new House(kitchen); house.testMethod(); } Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 59. Testing UI Components Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 60. Spare me Topic Designing Testable Code Presenter Bjorn Schultheiss
  • 61. Testing UI Components Possible but generally a pain, why? • test a style is applied • mimic user interaction • logic is is mixed with view Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 62. [Before(async,ui)] public function setUp() : void { myButton = new MyButton(); Async.proceedOnEvent( this, myButton, FlexEvent.CREATION_COMPLETE, 100 ); UIImpersonator.addChild( myButton ); }     [Test(async,ui)] public function myButton_myStyle_defaultValue() : void { Assert.assertEquals( myButton.getStyle( "myStyle" ), "expectedDefaultValue" ); } Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 63. UI Codefendants • UIImpersonator • invalidationModel • [Async] proceedOnEvent() • displayList hierarchy Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 64. Presentation Models http://martinfowler.com/eaaDev/PresentationModel.html Represent the state and behaviour of the presentation independently of the GUI controls used in the interface • uses Binding to interact with view • also handles events from view • a pattern used in popular frameworks • great for unit testing Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 65. Presentation Model example <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"> package presentation <fx:Script> { <![CDATA[ [Bindable] import presentation.HelloWorldModel; public class HelloWorldModel [Bindable] { public var model:HelloWorldModel; public var label:String = "Hello"; ]]> </fx:Script> public function clickHandler():void <s:Label text="{ model.label }" { click="model.clickHandler();" /> trace("Is it me your looking for?"); </s:Group> } } } Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 66. Business logic and PM’s Leave me out of it! • Presentation Models and Views have a 1 to 1 relationship • Business logic is best separated from PM’s • PM’s know about Business/Application classes, those classes know nothing about PM’s Topic Presenter Designing Testable Code Bjorn Schultheiss
  • 67. Well on your way Topic Designing Testable Code Presenter Bjorn Schultheiss
  • 68. Thanks, questions? Topic Presenter Designing Testable Code Bjorn Schultheiss

Editor's Notes

  1. I want to talk about future development opportunities for the adbuilder,\nmore premium engaging forms of advertising, and how to use html as an\noption for ad deployment.\n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. - doesnt interact with class data\n- users passed in to method\n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n