SlideShare a Scribd company logo
Software Engineering Robbie Clutton
readme.txt Started City University 2001 Did industrial placement with Lloyds TSB 2003-2004 Coding Cobol 74, editing code written before I was born! Graduated Software Engineering BEng 2005 Joined BT graduate scheme
readme.txt SDK to access BT Web Services in .NET C# Worked with customers to build prototypes against BT Web Services RESTful website using Ruby on Rails SIP Application Server to support BT Web Services using Java IVR Web Service using SIP A/S using Java Website using PHP
Unit Testing Tests a unit of code (e.g. a method) Doing the simplest thing that could possibly work Living documentation Allows refactoring Assert upon the correctness of the application
@Test public void testHelloWorld(){ // setup HelloWorld helloWorld =  new HelloWorld(); // act String result = helloWorld.sayHello(); // assert assertEquals("Hello", result); } package com.iclutton.seday; public class HelloWorld { public String sayHello() { return language.sayHello(); } }
Benefits unit testing Makes code cleaner Interfaces
package com.iclutton.seday.language; public interface Language { String sayHello(); } package com.iclutton.seday.language; public class English implements Language{ @Override public String sayHello() { return "Hello"; } } package com.iclutton.seday.language; public class French implements Language{ @Override public String sayHello(){ return "Bonjour"; } }
Mocking Useful when you want to ‘mock’ out external dependencies Databases Web services Etc Useful for simulating error conditions and handling
@Test public void testHelloWorldWithMock(){ // setup English english =  mock(English. class); when(english.sayHello()).thenReturn("Alright"); HelloWorld helloWorld =  new HelloWorld(); helloWorld.setLanguage(english); // act String result = helloWorld.sayHello(); // assert assertEquals("Alright", result); verify(english).sayHello(); } @Test(expected=IllegalStateException. class) public void testHelloWorldWithMockException(){ // setup English english =  mock(English. class); when(english.sayHello()).thenThrow( new RuntimeException()); HelloWorld helloWorld =  new HelloWorld(); helloWorld.setLanguage(english); // act helloWorld.sayHello(); // assert - see exception annotation }
Dependency Injection We’ve already seen dependency injection Now let’s look at Spring, which supports Reduces complexities of using interfaces Great way to configure applications Promotes the use of singletons Improves testability
<bean id=&quot;language&quot; class=&quot;com.iclutton.seday.language.English&quot;/> <bean id=&quot;hello&quot; class=&quot;com.iclutton.seday.HelloWorld&quot;> <property name=&quot;language&quot; ref=&quot;language&quot;/> </bean> @Test public void testSpring(){ // setup ApplicationContext applicationContext =  new    ClassPathXmlApplicationContext(&quot;applicationContext.xml&quot;); HelloWorld helloWorld = (HelloWorld)applicationContext.getBean(&quot;hello&quot;); // act String result = helloWorld.sayHello(); // assert assertEquals(&quot;Hello&quot;, result); }
Build Scripts Manual processes are more error prone Build scripts bring consistency and automation There are many varieties Ant (Java) nAnt (.NET) Make (C/C++) Rake (Ruby) etc
Property Driven Builds Useful when more that one person becomes involved Or deploying to different environments
Source Control
Automating the Build Continuous Integration
Logging Until you support an application you’ve built you will never know the value of logging
# Root category log4j.rootLogger=DEBUG, stdout log4j.logger.com.iclutton.seday=DEBUG # CONSOLE log4j.appender.stdout.Threshold=DEBUG log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d %X{stackname}[%t] %-5p [%C {1}.%M() %L] - %m%n 2008-11-18 18:06:39,953 [main] DEBUG [AbstractAutowireCapableBeanFactory$1.run() 411] - Finished creating instance of bean 'hello' 2008-11-18 18:06:39,953 [main] DEBUG [AbstractApplicationContext.publishEvent() 273] - Publishing event in context [org.springframework.context.support.ClassPathXmlApplicationContext@1e845c2]: org.springframework.context.event.ContextRefreshedEvent[source=org.springframework.context.support.ClassPathXmlApplicationContext@1e845c2: display name [org.springframework.context.support.ClassPathXmlApplicationContext@1e845c2]; startup date [Tue Nov 18 18:06:39 GMT 2008]; root of context hierarchy] 2008-11-18 18:06:39,953 [main] DEBUG [AbstractBeanFactory.doGetBean() 214] - Returning cached instance of singleton bean 'hello'
Q&A

More Related Content

What's hot (9)

PDF
Servlet Event framework
AshishSingh Bhatia
 
PDF
Java script
AshishSingh Bhatia
 
ODP
Decompiling Java - SCAM2009 Presentation
James Hamilton
 
PDF
From Good to Great: Functional and Acceptance Testing in WordPress.
David Aguilera
 
ODP
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
mguillem
 
PPTX
Testing React Applications
stbaechler
 
PDF
MUTANTS KILLER - PIT: state of the art of mutation testing system
Tarin Gamberini
 
PDF
Even better debugging; Equipped yourself with powerful tools.
Murshed Ahmmad Khan
 
PDF
React.js enlightenment
Artur Szott
 
Servlet Event framework
AshishSingh Bhatia
 
Java script
AshishSingh Bhatia
 
Decompiling Java - SCAM2009 Presentation
James Hamilton
 
From Good to Great: Functional and Acceptance Testing in WordPress.
David Aguilera
 
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
mguillem
 
Testing React Applications
stbaechler
 
MUTANTS KILLER - PIT: state of the art of mutation testing system
Tarin Gamberini
 
Even better debugging; Equipped yourself with powerful tools.
Murshed Ahmmad Khan
 
React.js enlightenment
Artur Szott
 

Viewers also liked (19)

PDF
Partidos políticos durante el tiempo de Isabel II
anga
 
DOCX
Revolución francesa: Desarrollo
anga
 
PDF
Regencias 2016
anga
 
PPTX
Jueves29
anga
 
PPTX
Esquemas tema 7 2º
anga
 
PPT
Cache me if you can
Robbie Clutton
 
PDF
Api - Hacks and Hackers
Robbie Clutton
 
DOC
Larestauraciónprimeraparte subrayado
anga
 
DOCX
Los usos del agua
anga
 
PPTX
La restauraciónparte1
anga
 
PPTX
La Restauración
anga
 
PDF
Comentario decreto 1823
anga
 
PDF
Crisis de 1898 subrayadopdf
anga
 
PDF
Dictadura de-primo-de-rivera
anga
 
DOCX
El franquismo
anga
 
DOCX
Década moderada y bienio progresista
anga
 
PDF
apuntes tema 1: paco quiñonero
anga
 
PDF
Práctica insolación
anga
 
PDF
Comentario manifiesto del manzanares
anga
 
Partidos políticos durante el tiempo de Isabel II
anga
 
Revolución francesa: Desarrollo
anga
 
Regencias 2016
anga
 
Jueves29
anga
 
Esquemas tema 7 2º
anga
 
Cache me if you can
Robbie Clutton
 
Api - Hacks and Hackers
Robbie Clutton
 
Larestauraciónprimeraparte subrayado
anga
 
Los usos del agua
anga
 
La restauraciónparte1
anga
 
La Restauración
anga
 
Comentario decreto 1823
anga
 
Crisis de 1898 subrayadopdf
anga
 
Dictadura de-primo-de-rivera
anga
 
El franquismo
anga
 
Década moderada y bienio progresista
anga
 
apuntes tema 1: paco quiñonero
anga
 
Práctica insolación
anga
 
Comentario manifiesto del manzanares
anga
 
Ad

Similar to Software Engineering (20)

ODP
Basic testing with selenium
Søren Lund
 
ODP
Bring the fun back to java
ciklum_ods
 
ODP
ActiveWeb: Chicago Java User Group Presentation
ipolevoy
 
PDF
02 servlet-basics
snopteck
 
PPT
Boosting Your Testing Productivity with Groovy
James Williams
 
PPT
Javaone2008 Bof 5101 Groovytesting
Andres Almiray
 
PPT
Stopping the Rot - Putting Legacy C++ Under Test
Seb Rose
 
PPTX
Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025
João Esperancinha
 
PDF
Mobile Development integration tests
Kenneth Poon
 
PDF
Silex and Twig (PHP Dorset talk)
Dave Hulbert
 
PPTX
Legacy Dependency Kata v2.0
William Munn
 
ODP
FluentSelenium Presentation Code Camp09
Pyxis Technologies
 
PPT
GTAC Boosting your Testing Productivity with Groovy
Andres Almiray
 
PDF
Introduction to Go language
Tzar Umang
 
PPTX
Testing with VS2010 - A Bugs Life
Peter Gfader
 
PPTX
XML-Free Programming
Stephen Chin
 
PPT
Pragmatic Parallels: Java and JavaScript
davejohnson
 
PPT
eXo SEA - JavaScript Introduction Training
Hoat Le
 
PPTX
Poco Es Mucho: WCF, EF, and Class Design
James Phillips
 
PPT
Ef Poco And Unit Testing
James Phillips
 
Basic testing with selenium
Søren Lund
 
Bring the fun back to java
ciklum_ods
 
ActiveWeb: Chicago Java User Group Presentation
ipolevoy
 
02 servlet-basics
snopteck
 
Boosting Your Testing Productivity with Groovy
James Williams
 
Javaone2008 Bof 5101 Groovytesting
Andres Almiray
 
Stopping the Rot - Putting Legacy C++ Under Test
Seb Rose
 
Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025
João Esperancinha
 
Mobile Development integration tests
Kenneth Poon
 
Silex and Twig (PHP Dorset talk)
Dave Hulbert
 
Legacy Dependency Kata v2.0
William Munn
 
FluentSelenium Presentation Code Camp09
Pyxis Technologies
 
GTAC Boosting your Testing Productivity with Groovy
Andres Almiray
 
Introduction to Go language
Tzar Umang
 
Testing with VS2010 - A Bugs Life
Peter Gfader
 
XML-Free Programming
Stephen Chin
 
Pragmatic Parallels: Java and JavaScript
davejohnson
 
eXo SEA - JavaScript Introduction Training
Hoat Le
 
Poco Es Mucho: WCF, EF, and Class Design
James Phillips
 
Ef Poco And Unit Testing
James Phillips
 
Ad

Recently uploaded (20)

PDF
HR agent at Mediq: Lessons learned on Agent Builder & Maestro by Tacstone Tec...
UiPathCommunity
 
PPTX
Machine Learning Benefits Across Industries
SynapseIndia
 
PDF
Market Wrap for 18th July 2025 by CIFDAQ
CIFDAQ
 
PDF
CloudStack GPU Integration - Rohit Yadav
ShapeBlue
 
PDF
How a Code Plagiarism Checker Protects Originality in Programming
Code Quiry
 
PDF
CIFDAQ'S Token Spotlight for 16th July 2025 - ALGORAND
CIFDAQ
 
PDF
Novus Safe Lite- What is Novus Safe Lite.pdf
Novus Hi-Tech
 
PDF
2025-07-15 EMEA Volledig Inzicht Dutch Webinar
ThousandEyes
 
PPTX
Top Managed Service Providers in Los Angeles
Captain IT
 
PDF
Trading Volume Explained by CIFDAQ- Secret Of Market Trends
CIFDAQ
 
PDF
Meetup Kickoff & Welcome - Rohit Yadav, CSIUG Chairman
ShapeBlue
 
PDF
Shuen Mei Parth Sharma Boost Productivity, Innovation and Efficiency wit...
AWS Chicago
 
PPTX
Lecture 5 - Agentic AI and model context protocol.pptx
Dr. LAM Yat-fai (林日辉)
 
PDF
OpenInfra ID 2025 - Are Containers Dying? Rethinking Isolation with MicroVMs.pdf
Muhammad Yuga Nugraha
 
PDF
visibel.ai Company Profile – Real-Time AI Solution for CCTV
visibelaiproject
 
PDF
The Past, Present & Future of Kenya's Digital Transformation
Moses Kemibaro
 
PDF
CIFDAQ Market Insight for 14th July 2025
CIFDAQ
 
PDF
Bitcoin+ Escalando sin concesiones - Parte 1
Fernando Paredes García
 
PPTX
python advanced data structure dictionary with examples python advanced data ...
sprasanna11
 
PDF
Building Resilience with Digital Twins : Lessons from Korea
SANGHEE SHIN
 
HR agent at Mediq: Lessons learned on Agent Builder & Maestro by Tacstone Tec...
UiPathCommunity
 
Machine Learning Benefits Across Industries
SynapseIndia
 
Market Wrap for 18th July 2025 by CIFDAQ
CIFDAQ
 
CloudStack GPU Integration - Rohit Yadav
ShapeBlue
 
How a Code Plagiarism Checker Protects Originality in Programming
Code Quiry
 
CIFDAQ'S Token Spotlight for 16th July 2025 - ALGORAND
CIFDAQ
 
Novus Safe Lite- What is Novus Safe Lite.pdf
Novus Hi-Tech
 
2025-07-15 EMEA Volledig Inzicht Dutch Webinar
ThousandEyes
 
Top Managed Service Providers in Los Angeles
Captain IT
 
Trading Volume Explained by CIFDAQ- Secret Of Market Trends
CIFDAQ
 
Meetup Kickoff & Welcome - Rohit Yadav, CSIUG Chairman
ShapeBlue
 
Shuen Mei Parth Sharma Boost Productivity, Innovation and Efficiency wit...
AWS Chicago
 
Lecture 5 - Agentic AI and model context protocol.pptx
Dr. LAM Yat-fai (林日辉)
 
OpenInfra ID 2025 - Are Containers Dying? Rethinking Isolation with MicroVMs.pdf
Muhammad Yuga Nugraha
 
visibel.ai Company Profile – Real-Time AI Solution for CCTV
visibelaiproject
 
The Past, Present & Future of Kenya's Digital Transformation
Moses Kemibaro
 
CIFDAQ Market Insight for 14th July 2025
CIFDAQ
 
Bitcoin+ Escalando sin concesiones - Parte 1
Fernando Paredes García
 
python advanced data structure dictionary with examples python advanced data ...
sprasanna11
 
Building Resilience with Digital Twins : Lessons from Korea
SANGHEE SHIN
 

Software Engineering

  • 2. readme.txt Started City University 2001 Did industrial placement with Lloyds TSB 2003-2004 Coding Cobol 74, editing code written before I was born! Graduated Software Engineering BEng 2005 Joined BT graduate scheme
  • 3. readme.txt SDK to access BT Web Services in .NET C# Worked with customers to build prototypes against BT Web Services RESTful website using Ruby on Rails SIP Application Server to support BT Web Services using Java IVR Web Service using SIP A/S using Java Website using PHP
  • 4. Unit Testing Tests a unit of code (e.g. a method) Doing the simplest thing that could possibly work Living documentation Allows refactoring Assert upon the correctness of the application
  • 5. @Test public void testHelloWorld(){ // setup HelloWorld helloWorld = new HelloWorld(); // act String result = helloWorld.sayHello(); // assert assertEquals(&quot;Hello&quot;, result); } package com.iclutton.seday; public class HelloWorld { public String sayHello() { return language.sayHello(); } }
  • 6. Benefits unit testing Makes code cleaner Interfaces
  • 7. package com.iclutton.seday.language; public interface Language { String sayHello(); } package com.iclutton.seday.language; public class English implements Language{ @Override public String sayHello() { return &quot;Hello&quot;; } } package com.iclutton.seday.language; public class French implements Language{ @Override public String sayHello(){ return &quot;Bonjour&quot;; } }
  • 8. Mocking Useful when you want to ‘mock’ out external dependencies Databases Web services Etc Useful for simulating error conditions and handling
  • 9. @Test public void testHelloWorldWithMock(){ // setup English english = mock(English. class); when(english.sayHello()).thenReturn(&quot;Alright&quot;); HelloWorld helloWorld = new HelloWorld(); helloWorld.setLanguage(english); // act String result = helloWorld.sayHello(); // assert assertEquals(&quot;Alright&quot;, result); verify(english).sayHello(); } @Test(expected=IllegalStateException. class) public void testHelloWorldWithMockException(){ // setup English english = mock(English. class); when(english.sayHello()).thenThrow( new RuntimeException()); HelloWorld helloWorld = new HelloWorld(); helloWorld.setLanguage(english); // act helloWorld.sayHello(); // assert - see exception annotation }
  • 10. Dependency Injection We’ve already seen dependency injection Now let’s look at Spring, which supports Reduces complexities of using interfaces Great way to configure applications Promotes the use of singletons Improves testability
  • 11. <bean id=&quot;language&quot; class=&quot;com.iclutton.seday.language.English&quot;/> <bean id=&quot;hello&quot; class=&quot;com.iclutton.seday.HelloWorld&quot;> <property name=&quot;language&quot; ref=&quot;language&quot;/> </bean> @Test public void testSpring(){ // setup ApplicationContext applicationContext = new ClassPathXmlApplicationContext(&quot;applicationContext.xml&quot;); HelloWorld helloWorld = (HelloWorld)applicationContext.getBean(&quot;hello&quot;); // act String result = helloWorld.sayHello(); // assert assertEquals(&quot;Hello&quot;, result); }
  • 12. Build Scripts Manual processes are more error prone Build scripts bring consistency and automation There are many varieties Ant (Java) nAnt (.NET) Make (C/C++) Rake (Ruby) etc
  • 13. Property Driven Builds Useful when more that one person becomes involved Or deploying to different environments
  • 15. Automating the Build Continuous Integration
  • 16. Logging Until you support an application you’ve built you will never know the value of logging
  • 17. # Root category log4j.rootLogger=DEBUG, stdout log4j.logger.com.iclutton.seday=DEBUG # CONSOLE log4j.appender.stdout.Threshold=DEBUG log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d %X{stackname}[%t] %-5p [%C {1}.%M() %L] - %m%n 2008-11-18 18:06:39,953 [main] DEBUG [AbstractAutowireCapableBeanFactory$1.run() 411] - Finished creating instance of bean 'hello' 2008-11-18 18:06:39,953 [main] DEBUG [AbstractApplicationContext.publishEvent() 273] - Publishing event in context [org.springframework.context.support.ClassPathXmlApplicationContext@1e845c2]: org.springframework.context.event.ContextRefreshedEvent[source=org.springframework.context.support.ClassPathXmlApplicationContext@1e845c2: display name [org.springframework.context.support.ClassPathXmlApplicationContext@1e845c2]; startup date [Tue Nov 18 18:06:39 GMT 2008]; root of context hierarchy] 2008-11-18 18:06:39,953 [main] DEBUG [AbstractBeanFactory.doGetBean() 214] - Returning cached instance of singleton bean 'hello'
  • 18. Q&A