Trigger a Build whenever a change occurs. it can help us reduce assumptions on a projecvt by rebuilding software whenever a change occurs in a version control system.

The value of CI:

  • Reduce risks

    • Defects are detected and fixed sooner
    • Health of software is measurable
    • Reduce assumptions
  • Reduce repetitive manual processes
    • CI can be run repeatly
  • Generate deployable software at any time and at any place
  • Enable better project visibility
    • Effective decisions
    • Noticing trends
  • Establish greater confidence in the software product from the development team

Steps of implement CI

  • Identify, find the processes that need to be automated
  • Build, create some scripts to run the process
  • Share, make everything managed by version control
  • Continuous, let script run when a change occurs

Best Practices using CI

  • Commit code frequently

    • Make small changes
    • Commit after each task
    • At least once a day
  • Do not commit broken code
    • Do not commit code that does not compile with other code or fails a test
  • Fix broken builds immediately
    • make it as high priority
  • Write automated developer tests
    • Make sure tests will be run during build
  • Run private builds
    • This is to prevent integration failure
  • Avoid getting broken code

Software Risks

  • Lack of Deployable Software

    • Little or no confidence in whether we could even build the software
    • Lengthy integration phases before delivering the software internally or externally, during which time nothing else got done
    • Inability to produce and reproduce testable builds
  • Late Discovery of Defects
  • Lack of Project Visibility
  • Low-quality Software

Build Software at Every Change

  • Perform build automatically
  • Perfomr build through single command
  • Separate build script from IDE
  • Centralize Software Assets
  • Create a Consistent Directory Structure
  • Fail Builds Fast
  • Build for Any Environment
  • Use a Dedicated Integration Build Machine
  • Use a CI Server
  • Run Manual Integration Builds
  • Run Fast Builds
  • Stage Builds

Build Type

  • Private Build
  • Integration Build
  • Release Build

Build Mechanisms

  • On-demand
  • Scheduled
  • Poll for changes
  • Event-driven

Responsibilities of CI Server

  • Poll for changes in the version control repository on a specified time interval
  • Perform certain actions on a scheduled basis, such as hourly or daily
  • Identify a "quiet period" during which no integration builds are performed for the project
  • Support for different build scripting tools including command-line tools such as Rake, make, Ant or NAnt
  • Send e-mails to the concerned parties
  • Display a history of previous builds
  • Display a dashboard that is Web accessible so that everyone can review integration build information -Support multiple version control systems for your different projects

Continuous Database Integration

  • Automate Database Integration
  • Use a Local Database Sandbox
  • Use a Version Control Repository to Share Database Assets
    • DDL to drop and create tables and views, including constraints and triggers
    • Stored procedures and functions
    • Entity relationship diagrams
    • Test data for differrent environments
    • Specific database configurations
  • Give Developers Capability to Modify the Database
  • Make DBA Part of Development Team

Repeatable Database Integration Activities

  • Drop database
  • Create database
  • Insert system data
  • Insert test data
  • Migrate database and data
  • Set up database instances in multiple environments
  • Modify column attributes and constraints
  • Modify test data
  • Modify stored procedures/functions/triggers
  • Obtain access to different environments
  • Back up/restore large data sets

The reliablity of a linear system is the product of the reliablity of each of the system's components, i.e. a system with three components, each component is 90% reliable, the the whold product is 73%(90%90%90%) reliable.

Unit tests verify the behavior of samll element in a software system, which are most often a single class.

Component or subsystem tests verify portions of a system and may require a fully installed system or some external dependencies, such as database, file system or network endpoint.

System tests exercise a complete software system and therefore require a fully installed system, such as a servlet container and associated databas.

Functional tests or acceptance tests are used to test the functionality of an application from the viewpoint of a client, which means the tests themselves mimic clients.

We need to categorize the tests during creating the test cases, as different kinds of tests need different duration to run.

Time requirement for test: Unit Test > Component Test > System Test

We should create test against defect. a test case can make sure: 1) you fix the defect; 2) prevent the defect from recurring.

Continuous Testing

  • Automate Unit Tests
  • Automate Component Tests
  • Automate System Tests
  • Automate Functional Tests
  • Categorize Developer Tests
  • Run Faster Tests First
  • Write Tests for Defects
  • Make Component Tests Repeatable
  • Limit Test Cases to One Asset

Pair programming is treated as best practice of Agile. but many companies can not afford it.

Peer-based code reviews are generally considered benegicial to the overall quality of a code base because they present opportunities for an objective analysis by a second pair of eyes.

There are many tools can help do this, like Java's PMD and .NET's FxCop.

We prefer to use tools to run inspection automatically, Once you run a automatic build, you should run automatic inspection.

We can use NDepend or some similiar tols to check the dependencies of different classes. it will generate a human readable html report.

We need to consider how to add inspection to continous integration process, it will improve software quality.

A typical deployment includes:

  • Label a repository's assets
  • Produce a clean environment, free of assumptions
  • Generate and label a build directly from the repository and install it on the target machine
  • Successfully run tests at all levels in a clone of the production environment
  • Create build feedback reports
  • If necessary, you can roll back the release by using labels in your version control repository

When preparing a clean environment, it may include:

  • Operating System
  • Operating system configuration, i.e. network connectivity/firewall
  • Server components for the software, i.e. database server/messaging server
  • Server configuration
  • Thrid-party tools, i.e. Web Frameworks
  • Custom software

Feedback is a key output for a CI system, we should send the right information to the right people at the right time and in the right way.

Everyone needs to reveive some type of feedback on the project, but not necessarily every item every time. Sending feedback to all project members too often will ensure that everyone begins to ignore the messages. it is important that your team does not learn to ignore messages from CI build process.

The following people should receive feedback:

  • Project Manager
  • Architect/Technical Lead
  • Developers
  • Testers

At the heart of continous feedback is reducing the time between when a defect is introduces, discovered and fixed.

We can use the following ways to deliver feedback:

  • eMail
  • SMS
  • Ambient Orb and X10 Devices
  • Windows Taskbar
  • Sounds
  • Wide-Screen Monitors

CI Tools

  • Anthillpro
  • Apache Continuum(Maven)
  • Banboo
  • BuildForge
  • Continous Integration Server Matrix
  • CruiseControl
  • CruiseControl.NET
  • Draco.NET
  • Gauntlet(not found)
  • LuntBuild
  • ParaBuild
  • PMEase QuickBuild
  • Sin

Build Script Tools

  • Ant
  • Groovy
  • Maven
  • NAnt
  • Rake

Version Control Tools

  • ClearCase
  • CVS
  • MKS
  • SubVersion
  • SnapshotCM
  • RTC
  • GitHub
  • Visual SourceSafe

DataBase Resources

  • Hypersonic DB
  • Mckoi
  • MySQL
  • Oracle
  • PostgreSQL

Test Tools

  • Agitator
  • DbUnit
  • Fit
  • FitNesse
  • Floyd(not found)
  • HtmlUnit
  • JUnit
  • JWebUnit
  • NDbUnit
  • NUnit
  • Selenium
  • SQLUnit
  • TestNG
  • utPLSQL
  • Watir
  • xUnit Test Patterns

Inspection Tools

  • Checkstyle
  • Clover
  • Cobertura
  • EMMA
  • FindBugs
  • FxCop
  • JavaNCSS
  • JDepend
  • NCover
  • NDepend
  • PMD
  • Simian
  • SourceMonitor

Deployment Resources

  • Capistrano

Documentation Resources

  • Doxygen
  • JavaDoc
  • NDoc
 

《Continuous Integration》读书笔记的更多相关文章

  1. csapp读书笔记-并发编程

    这是基础,理解不能有偏差 如果线程/进程的逻辑控制流在时间上重叠,那么就是并发的.我们可以将并发看成是一种os内核用来运行多个应用程序的实例,但是并发不仅在内核,在应用程序中的角色也很重要. 在应用级 ...

  2. CSAPP 读书笔记 - 2.31练习题

    根据等式(2-14) 假如w = 4 数值范围在-8 ~ 7之间 2^w = 16 x = 5, y = 4的情况下面 x + y = 9 >=2 ^(w-1)  属于第一种情况 sum = x ...

  3. CSAPP读书笔记--第八章 异常控制流

    第八章 异常控制流 2017-11-14 概述 控制转移序列叫做控制流.目前为止,我们学过两种改变控制流的方式: 1)跳转和分支: 2)调用和返回. 但是上面的方法只能控制程序本身,发生以下系统状态的 ...

  4. CSAPP 并发编程读书笔记

    CSAPP 并发编程笔记 并发和并行 并发:Concurrency,只要时间上重叠就算并发,可以是单处理器交替处理 并行:Parallel,属于并发的一种特殊情况(真子集),多核/多 CPU 同时处理 ...

  5. 读书笔记汇总 - SQL必知必会(第4版)

    本系列记录并分享学习SQL的过程,主要内容为SQL的基础概念及练习过程. 书目信息 中文名:<SQL必知必会(第4版)> 英文名:<Sams Teach Yourself SQL i ...

  6. 读书笔记--SQL必知必会18--视图

    读书笔记--SQL必知必会18--视图 18.1 视图 视图是虚拟的表,只包含使用时动态检索数据的查询. 也就是说作为视图,它不包含任何列和数据,包含的是一个查询. 18.1.1 为什么使用视图 重用 ...

  7. 《C#本质论》读书笔记(18)多线程处理

    .NET Framework 4.0 看(本质论第3版) .NET Framework 4.5 看(本质论第4版) .NET 4.0为多线程引入了两组新API:TPL(Task Parallel Li ...

  8. C#温故知新:《C#图解教程》读书笔记系列

    一.此书到底何方神圣? 本书是广受赞誉C#图解教程的最新版本.作者在本书中创造了一种全新的可视化叙述方式,以图文并茂的形式.朴实简洁的文字,并辅之以大量表格和代码示例,全面.直观地阐述了C#语言的各种 ...

  9. C#刨根究底:《你必须知道的.NET》读书笔记系列

    一.此书到底何方神圣? <你必须知道的.NET>来自于微软MVP—王涛(网名:AnyTao,博客园大牛之一,其博客地址为:http://anytao.cnblogs.com/)的最新技术心 ...

  10. Web高级征程:《大型网站技术架构》读书笔记系列

    一.此书到底何方神圣? <大型网站技术架构:核心原理与案例分析>通过梳理大型网站技术发展历程,剖析大型网站技术架构模式,深入讲述大型互联网架构设计的核心原理,并通过一组典型网站技术架构设计 ...

随机推荐

  1. python数据操作方法封装

    工作中经常会用到数据的插叙.单条数据插入和批量数据插入,以下是本人封装的一个类,推荐给各位: #!/usr/bin/env python # -*- coding:utf-8 -*- # Author ...

  2. Ionic 入门

    什么是lonic 简单来说lonic就是一款HTML5移动端应用开发框架,通过配合AngularJS和Cordova/PhoneGap可以开发一款移动端app,值得注意的是它创建的app是混合移动应用 ...

  3. DOM动态脚本和动态样式

    动态脚本 [定义] 在页面加载时不存在,但将来的某一时刻通过修改DOM动态添加的脚本. [方式] [1]插入外部文件方式 var script = document.createElement(&qu ...

  4. JAVA设计模式《一》

    设计模式(Design pattern)是一套被反复使用.多数人知晓的.经过分类编目的.代码设计经验的总结.使用设计模式是为了可重用代码.让代码更容易被他人理解.保证代码可靠性. 毫无疑问,设计模式于 ...

  5. SQL*Loader之CASE11

    CASE11 1. SQL脚本 [oracle@node3 ulcase]$ cat ulcase11.sql set termout off rem host write sys$output &q ...

  6. Java多线程系列--“基础篇”02之 常用的实现多线程的两种方式

    概要 本章,我们学习“常用的实现多线程的2种方式”:Thread 和 Runnable.之所以说是常用的,是因为通过还可以通过java.util.concurrent包中的线程池来实现多线程.关于线程 ...

  7. 让微信扫描直接下载你的APK

    去年在做一个项目的时候,用微信扫描apk下载失效,显示空白页,网上找找发现在后面加一个字符串即可,于是简单搞定.过了一阵子,今年不行了,我的敏捷个人下载二维码也失效了,今天和大家说一下,现在如何解决这 ...

  8. Maven使用详解

    Maven使用详解 世间万物相生相克,今年本来的目标是主要研究asp.net mvc以及windows平台相关的DI, ORM框架,突然有一天想研究一个Java EE里面相应的框架都是怎么玩的,于是研 ...

  9. golang中的race检测

    golang中的race检测 由于golang中的go是非常方便的,加上函数又非常容易隐藏go. 所以很多时候,当我们写出一个程序的时候,我们并不知道这个程序在并发情况下会不会出现什么问题. 所以在本 ...

  10. mysql 二进制日志后缀数字最大为多少

    之前看到mysql二进制日志后面会加一个以数字递增为结尾的后缀,一直在想当尾数到达999999后会发生什么情况,先查了一下官网,对后缀有这样一句介绍:The server creates binary ...