Monday, August 20, 2012

Notes on Kanban


Below are my notes on Kanban.

What is Kanban?


It's a Japanese word, it literally means "signboard" or "billboard," it is a concept related to lean and just-in-time (JIT) production. According to its creator, Taiichi Ohno, Kanban is one means through which JIT is achieved, he introduced this model for Toyota in mid 1920's. 
Kanban in software engineering is a flavor of Scrum methodology, in better words it is considered a leaner flavor of Scrum.

Why Kanban?

Implementing it can result in:

- Improved quality of work
- Faster turnaround of work requests
- Identification and elimination of bottlenecks
- Reduction of time work spends in queues
- Improved teamwork
- Reduction of wasted effort

How Kanban works?

Two most important Principles of Kanban are to:

       1- Visualize your work: Providing a means of visualizing work, allows you and others know what are you doing, What should I be working on right now?
       2- Limit work in process(WIP), which in turn:
1. reduces waste
2. improves quality
3. improves flow:  in Kanban Work processes should be optimized to maximize flow not capacity utilization! 100% utilization kills flow! An example of maximized capacity is a 100% CPU, which we all know it's not an good situation to be at.
                                
                                Little's Law shows that response time improves directly with reduction in WIP
               
                                Little's law Arrival rate=throughput
                                Length of queue=Arrival rate * average wait time
                                wait time= Length of Queue/Arrival rate
                                cycle time= WIP/throughput

                                Cycle time starts when work begins on the request and end when the item is ready for  delivery.
                                Lead time starts at feature request and ends when it is delivered
               

Team Kanban 

 Recipe for Success 


1- Focus on Quality
2- Reduce Work-in-Process 
3- Deliver often
  1. Reduced WIP, shortens Lead Time
  2. Shorter Lead Times allow for more frequent releases
  3. Frequent releases build trust!!! which is very important!

4- Balance Demand Against Throughput  
  1.      Not accepting new work at a rate that exceeds the rate that team produces. This will reveal bottle-necks activities in the process. 
  2.       You need slack  in order to improve or Kaizen , 100% utilization kills flow

5- Prioritize
6- Attack source of variability to improve predictability

  
References:







Wednesday, November 23, 2011

Code Camp - USC Campus October 2011



Oct 15 - 8:45 AM
Room: SLH-102
Notes:
Oct 15 - 10:00 AM
Room: SLH-102
Notes:
SOLID principles
Single Responsibility Principle:
"There should never be more than one reason for a class to change." — Robert Martin, SRP paper linked from The Principles of OOD
Open Closed Principle
Liskov Substitution Principle
Interface Segregation Principle
Dependency Inversion Principle

Oct 15 - 12:15 PM
Room: SLH-200
Notes:
HTML5 is the lingua franca on World Wide Web
Cross browser testing:
HTML5 Example sites:
Google body browser
Suggested Blogs:
Oct 15 - 1:30 PM

Room: SLH-200
Notes:
CSS3:
@media: media query is very powerful feature of CSS3, it queries screen and view from browser.
example: @media: screen and max : after
How to make your web application/site to act like a native application on mobile devices:
1- Add special size images to be used in "Add to home screen" feature of iPhone and etc ...
2- Make all links compatible to app style
3- Use native shell if needed
Oct 15 - 2:45 PM
Room: SLH-200
Notes:
- Use Visual Studio Mobile project MVC4
- Design choices:
1- One size fits all, this is MVC4.0 out of the box
2- Single page mobile app
- JQuery mobile site http://jquerymobile.com/ has great amount of examples and documentations
- Testing Tools:
The ones provided by hardware manufacturer (IOS,Android and Windows)
- Visual studio projects new project on MVC 4.0:
1- Internet Application: One size fit all application
2- Mobile application: this is for one page mobile app

Oct 15 - 4:00 PM
Room: ZHS-163
Notes:

- MVC 4.0 Developer preview is available now.
- Modernizer.js is part of MVC 4.0
- Adaptive rendering
- Targeting mobile, by just creating a file with .mobile extension. layout.mobile.cshtml
- Custom Modes

Thursday, April 14, 2011

How to configure Windows Server 2008 to host WCF services in IIS 7/WAS

Configuring Windows 2008 server for hosting WCF services in IIS7.0 and WAS


This document is focused on hosting a WCF service on Windows 2008 service Windows Activation Server (WAS). This service is utilizing tcp net as binding protocol.


Below are the steps:
  • Enable Network Discovery
  • Create a folder for your service code in root (c:\ MyService)
  • Add Roles and features:
    1. Add Web Service Role (IIS) to server, it will require to add WAS feature. (Figure 1)
    2. Add Application Server Role, this will require to install WAS feature. (Figure 2)
     Figure 1)  Adding Application/Web Server Roles 
     Figure 2) Adding Application Server Role
    Figure 3) Adding WAS Application Server Roles
    Figure 4) Choosing Authentication Certificate for SSL Encryption

  • Select all items under Security
  • Go to Features Expand .NET framework 4.0 Features, check WCF Activation box.(done in previous section)
  • Add Network Load Balancing Feature (See Figure 5) There will be another posting to cover setting up NLB.


Figure 5) NLB installation

    1. Register .NET Framework (use Framework64 folder if you are on a  64 bit machine)
      1. "%WINDIR%\Microsoft.Net\Framework\v4.0.30319\aspnet_regiis" –i –enable
    2. Register WCF   (use Framework64 folder if you are on a  64 bit machine)
      1.  "%WINDIR%\Microsoft.Net\Framework\v4.0.30319\ServiceModelReg.exe" -r


    1. Create Application/virtual directory
    2. Set additional virtual directory properties
    3. Set security:
    4. Add your designated service account myServiceAccount  to below User Groups
      1. Performance Log Users
      2. IIS_IUSRS



       Option 3: Enable a port range in advance. Start the Windows Firewall Control Panel applet
 and enable ports 80, 443, 8000-8003 and 9000, which are used by the samples. You can find more detailed instructions in the following procedure. This option is less secure than the others because it allows any program to use   these ports, not just the samples
    1. Chose option 3 from above link.       
    2. Create new Inbound, Outbound rules (named WCF-WF-TCP-Ports)
  • Edit site bindings: Run below commands

    Command1: %windir%\system32\inetsrv\appcmd.exe set site "Default Web Site" -+bindings.[protocol='net.tcp',bindingInformation='808:*']


                 Command2:%windir%\system32\inetsrv\appcmd.exe set app "Default Web      Site/yourServiceName" /enabledProtocols:http,net.tcp

Use a Meta Data Explorer to explore addresses:
Example client URI for MyService:
Client URI: net.tcp://servername.domain/MyService/MyService.svc
Meta Data URI: net.tcp://localhost/MyService/MyService.svc/mex

Related Links:
  1. http://msdn.microsoft.com/en-us/library/ms752218.aspx
  2. http://msdn.microsoft.com/en-us/library/ms751530.aspx
  3. http://msdn.microsoft.com/en-us/library/ms733768.aspx
  4. http://msdn.microsoft.com/en-us/library/ms751432.aspx
  5. http://msdn.microsoft.com/en-us/library/ms751527.aspx

Thursday, March 3, 2011

Patterns and Practices Symposium - Summary

It's been a while since I've blogged and it's been a while since I've been to this event but still I wanted to blog about it. Back in October 2010 I attended my first Patterns& Practices Symposium (PnP) in Redmond, Seattle. Link to: Patterns & Practices Symposium 2010
It was one of the best tech gatherings that I’ve ever attended and I have been to PDC, DevConnection and TechEd! Great crowd of attendees as well as awesome speakers and sessions
Anyway, below is a summary/abstract of the sessions and concepts that were discussed.


Sessions

Enterprise Library Extending
Parallel Programming
Cloud Computing
Windows Phone 7
OData – sesame data browser

Programming principles/Concepts

- Fluent Interface
- Inversion of Control
- DI – Dependency Injection (Unity, Spring or Castle Windsor)
- AOP – logging, exception handling
- CQRS - Command/Query Responsibility Separation
- M-V-VM
- Object Mother

SDLC Processes

Agile + TDD:

- Incremental improvement is the key to clean the old code and avoid massive redesign.
- Boy Scout rule, leave the camp cleaner than when you got it!
- In every check-in improve slightly.
- The only way to go fast is the go well (write good code pays off)
- Code Clean!
- Suite of tests gives you confidence to make changes improve/re-factored.
- Tests are used as documentation.
- Test needs to be designed well, decoupled.
- Manual test is expensive it grows.


TDD+ Validation+ Dependency injection


TDD Side Notes

TDD is the key for high quality code, it guarantees less bugs, it takes a little longer in beginning iterations but it pays off by the end of the project. It enforces developers (junior and senior) to follow the guaranteed path of TDD for quality code.

TDD requires development tool like re-sharper!

Continuous Integration Process:

CI Builds + Runs Test + Runs Code Coverage (95% for BLL, 85% for UI) + Code Analysis

Patterns of Healthy Teams using Visual Studio and TFS

- Turn on Code analysis at CI level, create your custom rule set and store it in TFS to be accessible
- Peer reviews catch about 60% of defects (Barry Boehm)

Options:

         1- Peer review
         2- Pair program
        3- Do micro-reviews, Make check-in notes required, encourages peers to


- Build Notification


- Layer Diagram

         - Document code for new developers
         - Validate Architecture
         - Generate Dependencies
        - Set Validation architecture to true at Project properties, which will generate error at CI

Flicker deploys code every 30 minutes
Gmail pushes new features are deployed in 2 days!

Tools

- Visual Studio Layer Diagram
- Visual Studio scrum templates – TFS installation required
- Instant Feature Builder VSIX
- Re-sharper
- Visual studio productivity tool

Summary

Focus of the conference was Agile + TDD + V-M-VM + Repository + Dependency Injection in Silverlight and WPF.

Wednesday, October 6, 2010

Service Design Considerations

 (Excerpts from Application Architecture Guide 2.0a)

Services are flexible by nature and can be used in a wide variety of scenarios and combinations.
The following are key typical scenarios:
• Service exposed over the Internet. This scenario describes a service that is consumed over
the Internet. Decisions on authentication and authorization must be based on Internet trust
boundaries and credentials options. For example, username authentication is more likely in
the Internet scenario than the intranet scenario. This scenario includes business-to-business
(B2B) as well as consumer-focused services. A Web site that allows you to schedule visits to
your family doctor would be an example of this scenario.
• Service exposed over an intranet. This scenario describes a service that is consumed over
an intranet. Decisions on authentication and authorization must be based on intranet trust
boundaries and credentials options. For example, the Microsoft® Active Directory®
directory service is more likely to be the chosen user store in the intranet scenario than in the
Internet scenario. An enterprise Web-mail application would be an example of this scenario.
• Service exposed on the local machine. This scenario describes a service that is consumed
by an application on the local machine. Transport and message-protection decisions must
be based on local machine trust boundaries and users.
• Mixed scenario. This scenario describes a service that is consumed by multiple applications
over the Internet, an intranet, and/or the local machine. A line-of-business (LOB) application
that is consumed internally by a thick client application and over the Internet by a Web
application would be an example of this scenario.

Design Considerations

When designing service-based applications, you should follow the general guidelines that apply
to all services, such as designing for coarse-grained operations, honoring the service contract,
and anticipating invalid requests or invalid request orders. In addition to the general guidelines,
there are specific guidelines that you should follow for different types of services. For example,
with a Service-Oriented Architecture (SOA), you should ensure that the operations are
application-scoped and that the service is autonomous. Alternatively, you might have an
application that provides workflow services, or you might be designing an operational data
store (ODS) that provides a service-based interface.

General Considerations

Design coarse-grained operations. Avoid chatty calls to the service interface, which can
lead to very poor performance. Instead, use the Façade pattern to package smaller fine-grained
operations into single coarse-grained operations.
Design entities for extensibility. Data contracts should be designed so that you can extend
them without affecting consumers of the service.
Compose entities from standard elements. When possible, compose the complex types
used by your service from standard elements.
Design without the assumption that you know who the client is. You should not make
assumptions about the client, and how they plan to use the service you provide.
Design only for the service contract. Do not implement functionality that is not reflected by
the service contract. In addition, the implementation of a service should never be exposed
to external consumers.
Design to assume the possibility of invalid requests. Never assume that all messages
received by the service are valid.
Separate functional business concerns from infrastructure operational concerns. Crosscutting
logic should never be combined with application logic. Doing so can lead to
implementations that are difficult to extend and maintain.
Ensure that the service can detect and manage repeated messages (idempotency). When
designing the service, implement well-known patterns, or take advantage of infrastructure
services, to ensure that duplicate messages are not processed.
Ensure that the service can manage messages arriving out of order (commutativity). If
there is a possibility that messages might arrive out of order, implement a design that will
store messages and then process them in the correct order.


SOA Services Considerations

Design services to be application-scoped and not component-scoped. Service operations
should be coarse-grained and focused on application operations. For example, with
demographics data, you should provide an operation that returns all of the data in one call.
You should not use multiple operations to return subsets of the data with multiple calls.
• Decouple the interface from the implementation. In an SOA application, it is very
important to keep internal business entities hidden from external clients. In other words,
you should never define a service interface that exposes internal business entities. Instead,
the service interface should be based on a contract with which external consumers interact.
Inside the service implementation, you translate between internal business entities and
external contracts.
Design services with explicit boundaries. A services application should be self-contained,
with strict boundaries. Access to the service should only be allowed through the service
interface layer.
Design services to be autonomous. Services should not require anything from consumers of
the service, and should not assume who the consumer is. In addition, you should design
services with the assumption that malformed requests will be sent to it.
Design compatibility based on policy. The service should publish a policy that describes
how consumers can interact with the service. This is more important for public services,
where consumers can examine the policy to determine interaction requirements.

Data Services Considerations

Avoid using services to expose individual tables in a database. This will lead to chatty
service calls and interdependencies between service operations, which can lead to
dependency issues for consumers of the service.
Do not implement business rules with data services. Different consumers of the data will
have unique viewpoints and rules. Attempting to implement rules in data access services
will impose restrictions on the use of that data.

Workflow Services Considerations

Use interfaces supported by your workflow engine. Attempting to create custom interfaces
can restrict the types of operations supported, and will increase the effort required to
extend and maintain the services.
• Design a service that is dedicated to supporting workflow. Instead of adding workflow
services to an existing service application, consider designing an autonomous service that
supports only workflow requirements.