SlideShare una empresa de Scribd logo
1 de 25
Descargar para leer sin conexión
Jenkins User Conference      San Francisco, Oct 2nd 2011   #jenkinsconf


       Twitter4J, Jenkins and Regression



                     Yusuke Yamamoto
                     Twitter4J.org / Twitter, Inc.
                                      http://twitter4j.org/
Jenkins User Conference   San Francisco, Oct 2nd 2011   #jenkinsconf



   Who Am I?




     10+ years experience in Java
     Author of open-source tools including:
      – Samurai http://samuraism.jp/samurai/
      – Twitter4J http://twitter4j.org/
Jenkins User Conference     San Francisco, Oct 2nd 2011   #jenkinsconf



   What is Twitter4J

     Open-source library for the Twitter API
     Compatible with
      – Java 1.4.2+
      – Android
      – Google App Engine
     Available since Jun 2007
Jenkins User Conference   San Francisco, Oct 2nd 2011   #jenkinsconf



   Tools Powering Twitter4J




                                           Maven Central repo
Jenkins User Conference        San Francisco, Oct 2nd 2011   #jenkinsconf


The release flow
                          release:perform

           git push origin master




                                               oss.sonatype.org
                          service hook
                                                    promote




     dev       twitter4j.org github.com repo1.maven.org
Jenkins User Conference     San Francisco, Oct 2nd 2011   #jenkinsconf



   Test-driven Development

            1. Write a test case which fails

            2. Implement and commit

            3. Run test cases

            4.   J NO regression
Jenkins User Conference   San Francisco, Oct 2nd 2011   #jenkinsconf



   The Timeline



     May 2007: Started Twitter4J project
     Mar 2009: Applied Hudson
Jenkins User Conference   San Francisco, Oct 2nd 2011   #jenkinsconf



   The Timeline



     May 2007: Started Twitter4J project
     Mar 2009: Applied Hudson

With Jenkins applied, your software
           should be regression free…
Jenkins User Conference   San Francisco, Oct 2nd 2011   #jenkinsconf



   The Timeline



     May 2007: Started Twitter4J project
     Mar 2009: Applied Hudson
     Oct 2010: Critical regression found
Jenkins User Conference   San Francisco, Oct 2nd 2011   #jenkinsconf



   The Timeline



     May 2007: Started Twitter4J project
     Mar 2009: Applied Hudson
     Oct 2010: Critical regression found


      The how and why
Jenkins User Conference     San Francisco, Oct 2nd 2011   #jenkinsconf




The Issue

 Version: Twitter4J 2.1.5
 Symptom: certain method calls fail with 401


401:Authentication credentials
  were missing or incorrect.
Jenkins User Conference           San Francisco, Oct 2nd 2011     #jenkinsconf




Direct Cause of the Issue
 bug in StringUtil – introduced in v2.1.5
  – leads invalid OAuth signature in certain condition
public static String[] split(String str, String separator){
 String[] returnValue;
 int index;
 if(-1 == str.indexOf(separator)){
  returnValue = new String[0];
 }else{
...

                            expected                     actual
  split(“foo,bar”,”,”)    {“foo”, “bar”}       √ {“foo”, “bar”}
  split(“foobar”,”,”)     {“foobar”}           L {}
Jenkins User Conference              San Francisco, Oct 2nd 2011   #jenkinsconf




 Why StringUtil.split()

  String#split() - @since Java1.4
  Found of a compatibility issue with CLDC
   – CLDC doesn’t support String#split()
Caused by: java.lang.NoSuchMethodError: java.lang.String: method split
           (Ljava/lang/String;)[Ljava/lang/String; not found
  at twitter4j.conf.PropertyConfiguration.setFieldsWithTreePath(Ljava/
 util/Properties;Ljava/lang/String;)V(PropertyConfiguration.java:196)
  at twitter4j.conf.PropertyConfiguration.<init>(Ljava/lang/String;)V
                   (PropertyConfiguration.java:121)
Jenkins User Conference       San Francisco, Oct 2nd 2011   #jenkinsconf




General Cause of Software Regressions



W/ test cases                 W/O test cases

        not enough test                    implementation
           coverage                       wrongly modified

                                       external resource
    test failure(s) ignored
                                      became incompatible
Jenkins User Conference      San Francisco, Oct 2nd 2011   #jenkinsconf




General Cause of Software Regressions



W/ test cases                W/O test cases

       not enough test                   implementation
          coverage                      wrongly modified

                                     external resource
   test failure(s) ignored
                                    became incompatible
Jenkins User Conference       San Francisco, Oct 2nd 2011   #jenkinsconf




General Cause of Software Regressions



W/ test cases                 W/O test cases

        not enough test                    implementation
           coverage                       wrongly modified

                                       external resource
    test failure(s) ignored
                                      became incompatible
Jenkins User Conference        San Francisco, Oct 2nd 2011   #jenkinsconf




Ignoring Failed Test Cases

 Generally not recommended
                  but
 Sometimes you need to, because
  – external resource not available
                          or
  – test failure caused by a component managed by
    other committer
Jenkins User Conference       San Francisco, Oct 2nd 2011   #jenkinsconf




General Cause of Software Regressions



W/ test cases                 W/O test cases

        not enough test                    implementation
           coverage                       wrongly modified

                                       external resource
    test failure(s) ignored
                                      became incompatible
Jenkins User Conference        San Francisco, Oct 2nd 2011   #jenkinsconf




General Cause of Software Regressions

 W/ test cases                 W/O test cases

         not enough test                   implementation
            coverage                      wrongly modified

                                        external resource
     test failure(s) ignored
                                       became incompatible

        test case wrongly
            modified
Jenkins User Conference               San Francisco, Oct 2nd 2011   #jenkinsconf



Ruined Tests with Basic Auth Deprecation
                          TwitterTestUnit
before refactoring:
                           test base class
 Basic auth & OAuth



                  BasicTest               OAuthTest
                 Basic auth                OAuth



 after refactoring:
  OAuth only                                     not recognized by Maven

                          TwitterTestUnit
Jenkins User Conference               San Francisco, Oct 2nd 2011   #jenkinsconf



Ruined Tests with Basic Auth Deprecation
                          TwitterTestUnit
before refactoring:
                           test base class
 Basic auth & OAuth



                  BasicTest               OAuthTest
                 Basic auth                OAuth



 after refactoring:
  OAuth only                                     not recognized by Maven

                          TwitterTestUnit
Jenkins User Conference   San Francisco, Oct 2nd 2011   #jenkinsconf




Lessons Learned - 1

 check the Ages of failed tests
Jenkins User Conference    San Francisco, Oct 2nd 2011   #jenkinsconf




Lessons Learned - 2
 be very careful when you refactor test cases
 make sure that
  – number of test cases doesn’t change many
  – code coverage doesn’t decrease




   smelly
   trend
Jenkins User Conference                San Francisco, Oct 2nd 2011   #jenkinsconf



   Thank You To Our Sponsors
    Platinum
    Sponsor

    Gold
    Sponsor

    Silver
    Sponsor

    Bronze
    Sponsors




Coming Soon: The CloudBees Newsletter for Jenkins

ü Please complete the Jenkins survey to help us better serve the community
     (bonus: a chance to win an Apple TV!)
Jenkins User Conference   San Francisco, Oct 2nd 2011   #jenkinsconf



   Who Am I?

Más contenido relacionado

Similar a Jenkins User Conference - Twitter4J, Jenkins and regression

QA in DevOps: Transformation thru Automation via Jenkins
QA in DevOps:  Transformation thru Automation via JenkinsQA in DevOps:  Transformation thru Automation via Jenkins
QA in DevOps: Transformation thru Automation via Jenkins
Tatyana Kravtsov
 
Frank's Learning Summary - Evolution of agile testing
Frank's Learning Summary - Evolution of agile testingFrank's Learning Summary - Evolution of agile testing
Frank's Learning Summary - Evolution of agile testing
Frank Lee
 

Similar a Jenkins User Conference - Twitter4J, Jenkins and regression (20)

JUC NY - Advanced Continuous Deployment with Jenkins
JUC NY - Advanced Continuous Deployment with JenkinsJUC NY - Advanced Continuous Deployment with Jenkins
JUC NY - Advanced Continuous Deployment with Jenkins
 
Beyond Continuous Delivery - Jenkins User Conference - 23 Oct 2014
Beyond Continuous Delivery - Jenkins User Conference - 23 Oct 2014Beyond Continuous Delivery - Jenkins User Conference - 23 Oct 2014
Beyond Continuous Delivery - Jenkins User Conference - 23 Oct 2014
 
Jenkins For One
Jenkins For OneJenkins For One
Jenkins For One
 
QA in DevOps: Transformation thru Automation via Jenkins
QA in DevOps:  Transformation thru Automation via JenkinsQA in DevOps:  Transformation thru Automation via Jenkins
QA in DevOps: Transformation thru Automation via Jenkins
 
Frank's Learning Summary - Evolution of agile testing
Frank's Learning Summary - Evolution of agile testingFrank's Learning Summary - Evolution of agile testing
Frank's Learning Summary - Evolution of agile testing
 
Supermondays: Jenkins CI lightning talk
Supermondays: Jenkins CI lightning talkSupermondays: Jenkins CI lightning talk
Supermondays: Jenkins CI lightning talk
 
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Seven Habits of Highly Effective Jenkins Users (2014 edition!)Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
 
Jenkins for One
Jenkins for OneJenkins for One
Jenkins for One
 
Continuous Integration
Continuous  IntegrationContinuous  Integration
Continuous Integration
 
varun JENKINS.pptx
varun JENKINS.pptxvarun JENKINS.pptx
varun JENKINS.pptx
 
Best Practices for Mission-Critical Jenkins
Best Practices for Mission-Critical JenkinsBest Practices for Mission-Critical Jenkins
Best Practices for Mission-Critical Jenkins
 
Jenkins Scriptler in 90mins
Jenkins Scriptler in 90minsJenkins Scriptler in 90mins
Jenkins Scriptler in 90mins
 
Basics of Selenium IDE,Core, Remote Control
Basics of Selenium IDE,Core, Remote ControlBasics of Selenium IDE,Core, Remote Control
Basics of Selenium IDE,Core, Remote Control
 
The Butler and the Snake - Continuous Integration for Python
The Butler and the Snake - Continuous Integration for PythonThe Butler and the Snake - Continuous Integration for Python
The Butler and the Snake - Continuous Integration for Python
 
Jenkins CI
Jenkins CIJenkins CI
Jenkins CI
 
JUC Europe 2015: How to Optimize Automated Testing with Everyone's Favorite B...
JUC Europe 2015: How to Optimize Automated Testing with Everyone's Favorite B...JUC Europe 2015: How to Optimize Automated Testing with Everyone's Favorite B...
JUC Europe 2015: How to Optimize Automated Testing with Everyone's Favorite B...
 
Building your Continuous Delivery Toolkit @ JUC SF 2014
Building your Continuous Delivery Toolkit @ JUC SF 2014Building your Continuous Delivery Toolkit @ JUC SF 2014
Building your Continuous Delivery Toolkit @ JUC SF 2014
 
Jenkins & IaC
Jenkins & IaCJenkins & IaC
Jenkins & IaC
 
Jenkins 1
Jenkins 1Jenkins 1
Jenkins 1
 
Testing JSF with Arquillian and Selenium
Testing JSF with Arquillian and SeleniumTesting JSF with Arquillian and Selenium
Testing JSF with Arquillian and Selenium
 

Más de Yusuke Yamamoto

WebStormから始まる快適Web開発ワークフロー #html5jk
WebStormから始まる快適Web開発ワークフロー #html5jkWebStormから始まる快適Web開発ワークフロー #html5jk
WebStormから始まる快適Web開発ワークフロー #html5jk
Yusuke Yamamoto
 
Troubleshooting Slowdowns, Freezes, Deadlocks : Introduction to Thread Dump #...
Troubleshooting Slowdowns, Freezes, Deadlocks : Introduction to Thread Dump #...Troubleshooting Slowdowns, Freezes, Deadlocks : Introduction to Thread Dump #...
Troubleshooting Slowdowns, Freezes, Deadlocks : Introduction to Thread Dump #...
Yusuke Yamamoto
 
Twitter API最新事情 - API Meetup Tokyo #1 #apijp
Twitter API最新事情 - API Meetup Tokyo #1 #apijpTwitter API最新事情 - API Meetup Tokyo #1 #apijp
Twitter API最新事情 - API Meetup Tokyo #1 #apijp
Yusuke Yamamoto
 
Java デバッガ活用術 ~勘デバッグ・print デバッグから抜けだそう~ #jjug_ccc #ccc_h4
Java デバッガ活用術 ~勘デバッグ・print デバッグから抜けだそう~ #jjug_ccc #ccc_h4Java デバッガ活用術 ~勘デバッグ・print デバッグから抜けだそう~ #jjug_ccc #ccc_h4
Java デバッガ活用術 ~勘デバッグ・print デバッグから抜けだそう~ #jjug_ccc #ccc_h4
Yusuke Yamamoto
 
貧乏人のHeroku活用術 #herokujp
貧乏人のHeroku活用術 #herokujp貧乏人のHeroku活用術 #herokujp
貧乏人のHeroku活用術 #herokujp
Yusuke Yamamoto
 
リーンスタートアップ x Java #jjug #jjug_ccc #ccc_h4
リーンスタートアップ x Java #jjug #jjug_ccc #ccc_h4リーンスタートアップ x Java #jjug #jjug_ccc #ccc_h4
リーンスタートアップ x Java #jjug #jjug_ccc #ccc_h4
Yusuke Yamamoto
 

Más de Yusuke Yamamoto (20)

株式会社サムライズム 新製品発表会 物理イカリングのご紹介 #gbdaitokai
株式会社サムライズム 新製品発表会 物理イカリングのご紹介 #gbdaitokai株式会社サムライズム 新製品発表会 物理イカリングのご紹介 #gbdaitokai
株式会社サムライズム 新製品発表会 物理イカリングのご紹介 #gbdaitokai
 
これからはじめるGit、GitHub #stapy
これからはじめるGit、GitHub #stapyこれからはじめるGit、GitHub #stapy
これからはじめるGit、GitHub #stapy
 
誰も知らない IntelliJ IDEA凄技100選 #kotlin_sansan
誰も知らない IntelliJ IDEA凄技100選 #kotlin_sansan誰も知らない IntelliJ IDEA凄技100選 #kotlin_sansan
誰も知らない IntelliJ IDEA凄技100選 #kotlin_sansan
 
JetBrains IDEハンズオン
JetBrains IDEハンズオンJetBrains IDEハンズオン
JetBrains IDEハンズオン
 
Java Küche 2016 LT 在室状況自動通知ボット #JavaKueche
Java Küche 2016 LT 在室状況自動通知ボット #JavaKuecheJava Küche 2016 LT 在室状況自動通知ボット #JavaKueche
Java Küche 2016 LT 在室状況自動通知ボット #JavaKueche
 
Java Küche 2016 #JavaKueche
Java Küche 2016 #JavaKuecheJava Küche 2016 #JavaKueche
Java Küche 2016 #JavaKueche
 
JavaOne2016 #CON5929 Time-Saving Tips and Tricks for Building Quality Java Ap...
JavaOne2016 #CON5929 Time-Saving Tips and Tricks for Building Quality Java Ap...JavaOne2016 #CON5929 Time-Saving Tips and Tricks for Building Quality Java Ap...
JavaOne2016 #CON5929 Time-Saving Tips and Tricks for Building Quality Java Ap...
 
WebStormから始まる快適Web開発ワークフロー #html5jk
WebStormから始まる快適Web開発ワークフロー #html5jkWebStormから始まる快適Web開発ワークフロー #html5jk
WebStormから始まる快適Web開発ワークフロー #html5jk
 
データクラスから始めるKotlin / JetBrainsに行ってきました #kotlin_kansai #jkug
データクラスから始めるKotlin / JetBrainsに行ってきました #kotlin_kansai #jkug データクラスから始めるKotlin / JetBrainsに行ってきました #kotlin_kansai #jkug
データクラスから始めるKotlin / JetBrainsに行ってきました #kotlin_kansai #jkug
 
Troubleshooting Slowdowns, Freezes, Deadlocks : Introduction to Thread Dump #...
Troubleshooting Slowdowns, Freezes, Deadlocks : Introduction to Thread Dump #...Troubleshooting Slowdowns, Freezes, Deadlocks : Introduction to Thread Dump #...
Troubleshooting Slowdowns, Freezes, Deadlocks : Introduction to Thread Dump #...
 
カジュアルにスレッドダンプ - @yusuke #javacasual
カジュアルにスレッドダンプ - @yusuke #javacasualカジュアルにスレッドダンプ - @yusuke #javacasual
カジュアルにスレッドダンプ - @yusuke #javacasual
 
Excel方眼紙アプリケーションサーバと侍の新機能 #jjug
Excel方眼紙アプリケーションサーバと侍の新機能 #jjugExcel方眼紙アプリケーションサーバと侍の新機能 #jjug
Excel方眼紙アプリケーションサーバと侍の新機能 #jjug
 
Twitter4jハンズオン 5/1 #twtr_hack
Twitter4jハンズオン 5/1 #twtr_hackTwitter4jハンズオン 5/1 #twtr_hack
Twitter4jハンズオン 5/1 #twtr_hack
 
株式会社サムライズム@samuraismがcoincheck for ECを使ってビットコイン決済に対応した話 #gbdaitokai
株式会社サムライズム@samuraismがcoincheck for ECを使ってビットコイン決済に対応した話 #gbdaitokai 株式会社サムライズム@samuraismがcoincheck for ECを使ってビットコイン決済に対応した話 #gbdaitokai
株式会社サムライズム@samuraismがcoincheck for ECを使ってビットコイン決済に対応した話 #gbdaitokai
 
Botを使った業務効率化 / Java8を使ったBot実装効率化 @yusuke #jjug
Botを使った業務効率化 / Java8を使ったBot実装効率化 @yusuke #jjugBotを使った業務効率化 / Java8を使ったBot実装効率化 @yusuke #jjug
Botを使った業務効率化 / Java8を使ったBot実装効率化 @yusuke #jjug
 
Twitter API最新事情 - API Meetup Tokyo #1 #apijp
Twitter API最新事情 - API Meetup Tokyo #1 #apijpTwitter API最新事情 - API Meetup Tokyo #1 #apijp
Twitter API最新事情 - API Meetup Tokyo #1 #apijp
 
Java デバッガ活用術 ~勘デバッグ・print デバッグから抜けだそう~ #jjug_ccc #ccc_h4
Java デバッガ活用術 ~勘デバッグ・print デバッグから抜けだそう~ #jjug_ccc #ccc_h4Java デバッガ活用術 ~勘デバッグ・print デバッグから抜けだそう~ #jjug_ccc #ccc_h4
Java デバッガ活用術 ~勘デバッグ・print デバッグから抜けだそう~ #jjug_ccc #ccc_h4
 
貧乏人のHeroku活用術 #herokujp
貧乏人のHeroku活用術 #herokujp貧乏人のHeroku活用術 #herokujp
貧乏人のHeroku活用術 #herokujp
 
リーンスタートアップ x Java #jjug #jjug_ccc #ccc_h4
リーンスタートアップ x Java #jjug #jjug_ccc #ccc_h4リーンスタートアップ x Java #jjug #jjug_ccc #ccc_h4
リーンスタートアップ x Java #jjug #jjug_ccc #ccc_h4
 
JavaScript時代のJava #kansumiB7 #kansumi
JavaScript時代のJava #kansumiB7 #kansumiJavaScript時代のJava #kansumiB7 #kansumi
JavaScript時代のJava #kansumiB7 #kansumi
 

Último

Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
UXDXConf
 

Último (20)

FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
Agentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdfAgentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdf
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 

Jenkins User Conference - Twitter4J, Jenkins and regression

  • 1. Jenkins User Conference San Francisco, Oct 2nd 2011 #jenkinsconf Twitter4J, Jenkins and Regression Yusuke Yamamoto Twitter4J.org / Twitter, Inc. http://twitter4j.org/
  • 2. Jenkins User Conference San Francisco, Oct 2nd 2011 #jenkinsconf Who Am I? 10+ years experience in Java Author of open-source tools including: – Samurai http://samuraism.jp/samurai/ – Twitter4J http://twitter4j.org/
  • 3. Jenkins User Conference San Francisco, Oct 2nd 2011 #jenkinsconf What is Twitter4J Open-source library for the Twitter API Compatible with – Java 1.4.2+ – Android – Google App Engine Available since Jun 2007
  • 4. Jenkins User Conference San Francisco, Oct 2nd 2011 #jenkinsconf Tools Powering Twitter4J Maven Central repo
  • 5. Jenkins User Conference San Francisco, Oct 2nd 2011 #jenkinsconf The release flow release:perform git push origin master oss.sonatype.org service hook promote dev twitter4j.org github.com repo1.maven.org
  • 6. Jenkins User Conference San Francisco, Oct 2nd 2011 #jenkinsconf Test-driven Development 1. Write a test case which fails 2. Implement and commit 3. Run test cases 4. J NO regression
  • 7. Jenkins User Conference San Francisco, Oct 2nd 2011 #jenkinsconf The Timeline May 2007: Started Twitter4J project Mar 2009: Applied Hudson
  • 8. Jenkins User Conference San Francisco, Oct 2nd 2011 #jenkinsconf The Timeline May 2007: Started Twitter4J project Mar 2009: Applied Hudson With Jenkins applied, your software should be regression free…
  • 9. Jenkins User Conference San Francisco, Oct 2nd 2011 #jenkinsconf The Timeline May 2007: Started Twitter4J project Mar 2009: Applied Hudson Oct 2010: Critical regression found
  • 10. Jenkins User Conference San Francisco, Oct 2nd 2011 #jenkinsconf The Timeline May 2007: Started Twitter4J project Mar 2009: Applied Hudson Oct 2010: Critical regression found The how and why
  • 11. Jenkins User Conference San Francisco, Oct 2nd 2011 #jenkinsconf The Issue Version: Twitter4J 2.1.5 Symptom: certain method calls fail with 401 401:Authentication credentials were missing or incorrect.
  • 12. Jenkins User Conference San Francisco, Oct 2nd 2011 #jenkinsconf Direct Cause of the Issue bug in StringUtil – introduced in v2.1.5 – leads invalid OAuth signature in certain condition public static String[] split(String str, String separator){ String[] returnValue; int index; if(-1 == str.indexOf(separator)){ returnValue = new String[0]; }else{ ... expected actual split(“foo,bar”,”,”) {“foo”, “bar”} √ {“foo”, “bar”} split(“foobar”,”,”) {“foobar”} L {}
  • 13. Jenkins User Conference San Francisco, Oct 2nd 2011 #jenkinsconf Why StringUtil.split() String#split() - @since Java1.4 Found of a compatibility issue with CLDC – CLDC doesn’t support String#split() Caused by: java.lang.NoSuchMethodError: java.lang.String: method split (Ljava/lang/String;)[Ljava/lang/String; not found at twitter4j.conf.PropertyConfiguration.setFieldsWithTreePath(Ljava/ util/Properties;Ljava/lang/String;)V(PropertyConfiguration.java:196) at twitter4j.conf.PropertyConfiguration.<init>(Ljava/lang/String;)V (PropertyConfiguration.java:121)
  • 14. Jenkins User Conference San Francisco, Oct 2nd 2011 #jenkinsconf General Cause of Software Regressions W/ test cases W/O test cases not enough test implementation coverage wrongly modified external resource test failure(s) ignored became incompatible
  • 15. Jenkins User Conference San Francisco, Oct 2nd 2011 #jenkinsconf General Cause of Software Regressions W/ test cases W/O test cases not enough test implementation coverage wrongly modified external resource test failure(s) ignored became incompatible
  • 16. Jenkins User Conference San Francisco, Oct 2nd 2011 #jenkinsconf General Cause of Software Regressions W/ test cases W/O test cases not enough test implementation coverage wrongly modified external resource test failure(s) ignored became incompatible
  • 17. Jenkins User Conference San Francisco, Oct 2nd 2011 #jenkinsconf Ignoring Failed Test Cases Generally not recommended but Sometimes you need to, because – external resource not available or – test failure caused by a component managed by other committer
  • 18. Jenkins User Conference San Francisco, Oct 2nd 2011 #jenkinsconf General Cause of Software Regressions W/ test cases W/O test cases not enough test implementation coverage wrongly modified external resource test failure(s) ignored became incompatible
  • 19. Jenkins User Conference San Francisco, Oct 2nd 2011 #jenkinsconf General Cause of Software Regressions W/ test cases W/O test cases not enough test implementation coverage wrongly modified external resource test failure(s) ignored became incompatible test case wrongly modified
  • 20. Jenkins User Conference San Francisco, Oct 2nd 2011 #jenkinsconf Ruined Tests with Basic Auth Deprecation TwitterTestUnit before refactoring: test base class Basic auth & OAuth BasicTest OAuthTest Basic auth OAuth after refactoring: OAuth only not recognized by Maven TwitterTestUnit
  • 21. Jenkins User Conference San Francisco, Oct 2nd 2011 #jenkinsconf Ruined Tests with Basic Auth Deprecation TwitterTestUnit before refactoring: test base class Basic auth & OAuth BasicTest OAuthTest Basic auth OAuth after refactoring: OAuth only not recognized by Maven TwitterTestUnit
  • 22. Jenkins User Conference San Francisco, Oct 2nd 2011 #jenkinsconf Lessons Learned - 1 check the Ages of failed tests
  • 23. Jenkins User Conference San Francisco, Oct 2nd 2011 #jenkinsconf Lessons Learned - 2 be very careful when you refactor test cases make sure that – number of test cases doesn’t change many – code coverage doesn’t decrease smelly trend
  • 24. Jenkins User Conference San Francisco, Oct 2nd 2011 #jenkinsconf Thank You To Our Sponsors Platinum Sponsor Gold Sponsor Silver Sponsor Bronze Sponsors Coming Soon: The CloudBees Newsletter for Jenkins ü Please complete the Jenkins survey to help us better serve the community (bonus: a chance to win an Apple TV!)
  • 25. Jenkins User Conference San Francisco, Oct 2nd 2011 #jenkinsconf Who Am I?