SlideShare une entreprise Scribd logo
1  sur  33
Télécharger pour lire hors ligne
TDD
RED
 GREEN
REFACTOR
Effect?
More code
More simple code
More simple code,
 delivered faster
Cleaner
interfaces
Better
understanding
 of codebase
Fast & precise
  regression
   discovery
Easy
refactoring
Case
study
Things come together.




    Semantic social
collaboration platform
Things come together.


Python/Django
PostgreSQL
Apache Solr
Custom Java backend
RDF-based APIs

Graphs of linked data
URIs as identifiers
Subject-Predicate-Object
triples
<_:me>   <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
<_:me>   <http://xmlns.com/foaf/0.1/family_name> "Pasternacki" .
<_:me>   <http://xmlns.com/foaf/0.1/givenname> "Maciej" .
<_:me>   <http://xmlns.com/foaf/0.1/homepage> <http://www.pasternacki.net/> .
<_:me>   <http://xmlns.com/foaf/0.1/mbox> <mailto:maciej@pasternacki.net> .
<_:me>   <http://xmlns.com/foaf/0.1/name> "Maciej Pasternacki" .
<_:me>   <http://xmlns.com/foaf/0.1/nick> "japhy" .
<_:me>   <http://xmlns.com/foaf/0.1/workplaceHomepage> <http://www.gnowsis.com/> .




  @prefix : <#> .
  @prefix foaf: <http://xmlns.com/foaf/0.1/> .

  :me     a foaf:Person .
  :me     foaf:family_name "Pasternacki" .
  :me     foaf:givenname "Maciej" .
  :me     foaf:homepage <http://www.pasternacki.net/> .
  :me     foaf:mbox <mailto:maciej@pasternacki.net> .
  :me     foaf:name "Maciej Pasternacki" .
  :me     foaf:nick "japhy" .
  :me     foaf:workplaceHomepage <http://www.gnowsis.com/> .
Item                                  Relation
                              uuid : uuid                                    type : uri
                              rdf_type : URI                             *
                              label : string
                              created : dateTime
                              lastModified: dateTime                        Description
                                                                         text : string
                                 target (1)
                         Thing                 Annotation                      Rating
                                                                      value : normalizedFloat


                     InformationElement                                             Wiki
                                                                             text : string
                                                     Property
         File
                                               type : uri
path : string
                                               lexicalForm : string
mimeType : string
...                          Webpage
                        url : string
                        summary : string        StringProperty
      Email
  subject : string                             value : string
  ...                                               IntProperty
                                                  value : integer
         Blogpost                 Tweet               DatetimeProperty
 timestamp : dateTime        author : string          value : datetime
 author : string             text : string
 ...                         ...
def promote(self):
         if not hasattr(self, '_promoted'):
             if isinstance(self, self.get_class()):
                 self._promoted = self
             else:
                 self._promoted = getattr(
                     self, getattr( self.get_class(),
                                    self._root_class_name + '_ptr'
                                    ).field.related_query_name() )
         return self._promoted



SELECT … FROM "pim_annotation"
LEFT OUTER JOIN "pim_related"
ON ("pim_annotation"."id" = "pim_related"."annotation_ptr_id")
WHERE ( "pim_annotation"."thing_id" = E'∴'
        OR "pim_related"."related_to_id" = E'∴' )
ORDER BY "pim_annotation"."lastModified" DESC;
NoSQL?
NoSQL?
“How FriendFeed
uses MySQL to store
 schema-less data”
-- http://bret.appspot.com/entry/how-friendfeed-uses-mysql
Use PostgreSQL
as RDF document-
oriented database
Single Thing class

Many concrete
Annotation classes

TEXT field `attributes’
for free-form RDF
No JOINs
Rules

Keep existing code
(when possible)

Keep existing behaviour
Keep magic localized
I. New code


RDFField & URIRefField using
rdflib
Customized RDF serialization
II. Analysis

Extract existing schema from
model code
Declare schema in RDF
Glue code for attribute access to
RDF data
nfo:Bookmark rdfs:subClassOf pimo:Thing ;
             grfs:className "Bookmark" ;
             grfs:label "nfo:Bookmark" ;
             grfs:pluralLabel "nfo:Bookmarks" ;
             grfs:isGuiCreatable "true"^^xsd:boolean ;
             grfs:labelProperties ( dct:title rdfs:label nfo:bookmarks ) ;
             grfs:shortSummaryInfoProperties ( nfo:bookmarks ) .

nao:description a rdfs:Property ;
           rdfs:domain pimo:Thing, pimo:Person, pimo:Event, nfo:Bookmark,
pimo:Project, pimo:Person, nfo:FileDataObject, pimo:Topic, pimo:Location,
pimo:Task, nmo:Email, pimo:Question, pimo:Organization, pimo:Note,
pimo:Collection;
           grfs:attributeName "description" ;
           grfs:ftsFullText "true"^^xsd:boolean ;
           grfs:additionalShortSummaryInfo "false"^^xsd:boolean .

nfo:bookmarks a rdfs:Property ;
              rdfs:domain nfo:Bookmark ;
              grfs:attributeName "bookmarks" ;
              grfs:ftsFullText "true"^^xsd:boolean ;
              grfs:additionalShortSummaryInfo "true"^^xsd:boolean .
SELF_URI = URIRef('self:#')
def __getattr__(self, attr):
    property_uri = attribute_uri(attr)
    oo = list(self.attributes.objects(
                self.SELF_URI,
                property_uri))
    if not oo:
        raise AttributeError(attr)
    if len(oo) == 1:
        return oo[0].toPython()
    return set([o.toPython() for o in oo])
III. Details

Run test suite
Find most common error
Adapt test or change code
Repeat for three weeks
IV. Tweaking


Data migration
Refactor APIs
Optimize
Success!
Things come together.


http://www.getrefinder.com/

Contenu connexe

Tendances

MongoDB San Francisco 2013: Data Modeling Examples From the Real World presen...
MongoDB San Francisco 2013: Data Modeling Examples From the Real World presen...MongoDB San Francisco 2013: Data Modeling Examples From the Real World presen...
MongoDB San Francisco 2013: Data Modeling Examples From the Real World presen...MongoDB
 
Euroscipy SemNews 2011
Euroscipy SemNews 2011Euroscipy SemNews 2011
Euroscipy SemNews 2011Logilab
 
Data Modeling for the Real World
Data Modeling for the Real WorldData Modeling for the Real World
Data Modeling for the Real WorldMike Friedman
 
Mongo DB schema design patterns
Mongo DB schema design patternsMongo DB schema design patterns
Mongo DB schema design patternsjoergreichert
 
Building web applications with mongo db presentation
Building web applications with mongo db presentationBuilding web applications with mongo db presentation
Building web applications with mongo db presentationMurat Çakal
 
Schema Design with MongoDB
Schema Design with MongoDBSchema Design with MongoDB
Schema Design with MongoDBrogerbodamer
 
Schema Design by Example ~ MongoSF 2012
Schema Design by Example ~ MongoSF 2012Schema Design by Example ~ MongoSF 2012
Schema Design by Example ~ MongoSF 2012hungarianhc
 
Data Modeling Deep Dive
Data Modeling Deep DiveData Modeling Deep Dive
Data Modeling Deep DiveMongoDB
 

Tendances (12)

MongoDB San Francisco 2013: Data Modeling Examples From the Real World presen...
MongoDB San Francisco 2013: Data Modeling Examples From the Real World presen...MongoDB San Francisco 2013: Data Modeling Examples From the Real World presen...
MongoDB San Francisco 2013: Data Modeling Examples From the Real World presen...
 
Euroscipy SemNews 2011
Euroscipy SemNews 2011Euroscipy SemNews 2011
Euroscipy SemNews 2011
 
Data Modeling for the Real World
Data Modeling for the Real WorldData Modeling for the Real World
Data Modeling for the Real World
 
J s-o-n-120219575328402-3
J s-o-n-120219575328402-3J s-o-n-120219575328402-3
J s-o-n-120219575328402-3
 
Mongo DB schema design patterns
Mongo DB schema design patternsMongo DB schema design patterns
Mongo DB schema design patterns
 
Building web applications with mongo db presentation
Building web applications with mongo db presentationBuilding web applications with mongo db presentation
Building web applications with mongo db presentation
 
SWT Lecture Session 8 - Rules
SWT Lecture Session 8 - RulesSWT Lecture Session 8 - Rules
SWT Lecture Session 8 - Rules
 
Schema Design with MongoDB
Schema Design with MongoDBSchema Design with MongoDB
Schema Design with MongoDB
 
Schema Design by Example ~ MongoSF 2012
Schema Design by Example ~ MongoSF 2012Schema Design by Example ~ MongoSF 2012
Schema Design by Example ~ MongoSF 2012
 
Elastic search 검색
Elastic search 검색Elastic search 검색
Elastic search 검색
 
RDF data validation 2017 SHACL
RDF data validation 2017 SHACLRDF data validation 2017 SHACL
RDF data validation 2017 SHACL
 
Data Modeling Deep Dive
Data Modeling Deep DiveData Modeling Deep Dive
Data Modeling Deep Dive
 

Similaire à Test-driven development: a case study

The InfoGrid Graph DataBase
The InfoGrid Graph DataBaseThe InfoGrid Graph DataBase
The InfoGrid Graph DataBaseInfoGrid.org
 
Jazoon 2010 - Building DSLs with Eclipse
Jazoon 2010 - Building DSLs with EclipseJazoon 2010 - Building DSLs with Eclipse
Jazoon 2010 - Building DSLs with EclipsePeter Friese
 
GramsciProject - technical presentation
GramsciProject - technical presentationGramsciProject - technical presentation
GramsciProject - technical presentationChristian Morbidoni
 
Build JSON and XML using RABL gem
Build JSON and XML using RABL gemBuild JSON and XML using RABL gem
Build JSON and XML using RABL gemNascenia IT
 
Building DSLs With Eclipse
Building DSLs With EclipseBuilding DSLs With Eclipse
Building DSLs With EclipsePeter Friese
 
Spark schema for free with David Szakallas
Spark schema for free with David SzakallasSpark schema for free with David Szakallas
Spark schema for free with David SzakallasDatabricks
 
Scaling search to a million pages with Solr, Python, and Django
Scaling search to a million pages with Solr, Python, and DjangoScaling search to a million pages with Solr, Python, and Django
Scaling search to a million pages with Solr, Python, and Djangotow21
 
The design, architecture, and tradeoffs of FluidDB
The design, architecture, and tradeoffs of FluidDBThe design, architecture, and tradeoffs of FluidDB
The design, architecture, and tradeoffs of FluidDBTerry Jones
 
Sparse Content Map Storage System
Sparse Content Map Storage SystemSparse Content Map Storage System
Sparse Content Map Storage Systemianeboston
 
Pyconie 2012
Pyconie 2012Pyconie 2012
Pyconie 2012Yaqi Zhao
 
descriptive programming
descriptive programmingdescriptive programming
descriptive programmingAnand Dhana
 
Staab programming thesemanticweb
Staab programming thesemanticwebStaab programming thesemanticweb
Staab programming thesemanticwebAneta Tu
 
ESWC SS 2013 - Tuesday Keynote Steffen Staab: Programming the Semantic Web
ESWC SS 2013 - Tuesday Keynote Steffen Staab: Programming the Semantic WebESWC SS 2013 - Tuesday Keynote Steffen Staab: Programming the Semantic Web
ESWC SS 2013 - Tuesday Keynote Steffen Staab: Programming the Semantic Webeswcsummerschool
 
Declarative Data Modeling in Python
Declarative Data Modeling in PythonDeclarative Data Modeling in Python
Declarative Data Modeling in PythonJoshua Forman
 
Attacks against Microsoft network web clients
Attacks against Microsoft network web clients Attacks against Microsoft network web clients
Attacks against Microsoft network web clients Positive Hack Days
 
From 0 to 60 in SPARQL in 50 Minutes
From 0 to 60 in SPARQL in 50 MinutesFrom 0 to 60 in SPARQL in 50 Minutes
From 0 to 60 in SPARQL in 50 Minutesewg118
 
Working with the Web: 
Decoding JSON
Working with the Web: 
Decoding JSONWorking with the Web: 
Decoding JSON
Working with the Web: 
Decoding JSONSV.CO
 
Programming the Semantic Web
Programming the Semantic WebProgramming the Semantic Web
Programming the Semantic WebSteffen Staab
 

Similaire à Test-driven development: a case study (20)

Jena Programming
Jena ProgrammingJena Programming
Jena Programming
 
The InfoGrid Graph DataBase
The InfoGrid Graph DataBaseThe InfoGrid Graph DataBase
The InfoGrid Graph DataBase
 
Jazoon 2010 - Building DSLs with Eclipse
Jazoon 2010 - Building DSLs with EclipseJazoon 2010 - Building DSLs with Eclipse
Jazoon 2010 - Building DSLs with Eclipse
 
GramsciProject - technical presentation
GramsciProject - technical presentationGramsciProject - technical presentation
GramsciProject - technical presentation
 
Build JSON and XML using RABL gem
Build JSON and XML using RABL gemBuild JSON and XML using RABL gem
Build JSON and XML using RABL gem
 
Building DSLs With Eclipse
Building DSLs With EclipseBuilding DSLs With Eclipse
Building DSLs With Eclipse
 
Spark schema for free with David Szakallas
Spark schema for free with David SzakallasSpark schema for free with David Szakallas
Spark schema for free with David Szakallas
 
Scaling search to a million pages with Solr, Python, and Django
Scaling search to a million pages with Solr, Python, and DjangoScaling search to a million pages with Solr, Python, and Django
Scaling search to a million pages with Solr, Python, and Django
 
Dynamic Python
Dynamic PythonDynamic Python
Dynamic Python
 
The design, architecture, and tradeoffs of FluidDB
The design, architecture, and tradeoffs of FluidDBThe design, architecture, and tradeoffs of FluidDB
The design, architecture, and tradeoffs of FluidDB
 
Sparse Content Map Storage System
Sparse Content Map Storage SystemSparse Content Map Storage System
Sparse Content Map Storage System
 
Pyconie 2012
Pyconie 2012Pyconie 2012
Pyconie 2012
 
descriptive programming
descriptive programmingdescriptive programming
descriptive programming
 
Staab programming thesemanticweb
Staab programming thesemanticwebStaab programming thesemanticweb
Staab programming thesemanticweb
 
ESWC SS 2013 - Tuesday Keynote Steffen Staab: Programming the Semantic Web
ESWC SS 2013 - Tuesday Keynote Steffen Staab: Programming the Semantic WebESWC SS 2013 - Tuesday Keynote Steffen Staab: Programming the Semantic Web
ESWC SS 2013 - Tuesday Keynote Steffen Staab: Programming the Semantic Web
 
Declarative Data Modeling in Python
Declarative Data Modeling in PythonDeclarative Data Modeling in Python
Declarative Data Modeling in Python
 
Attacks against Microsoft network web clients
Attacks against Microsoft network web clients Attacks against Microsoft network web clients
Attacks against Microsoft network web clients
 
From 0 to 60 in SPARQL in 50 Minutes
From 0 to 60 in SPARQL in 50 MinutesFrom 0 to 60 in SPARQL in 50 Minutes
From 0 to 60 in SPARQL in 50 Minutes
 
Working with the Web: 
Decoding JSON
Working with the Web: 
Decoding JSONWorking with the Web: 
Decoding JSON
Working with the Web: 
Decoding JSON
 
Programming the Semantic Web
Programming the Semantic WebProgramming the Semantic Web
Programming the Semantic Web
 

Plus de Maciej Pasternacki

A Continuous Packaging Pipeline
A Continuous Packaging PipelineA Continuous Packaging Pipeline
A Continuous Packaging PipelineMaciej Pasternacki
 
Why do we fail? (And how do we stop doing that?
Why do we fail? (And how do we stop doing that?Why do we fail? (And how do we stop doing that?
Why do we fail? (And how do we stop doing that?Maciej Pasternacki
 
Amazon Web Services (cloud: is it good for anything?)
Amazon Web Services (cloud: is it good for anything?)Amazon Web Services (cloud: is it good for anything?)
Amazon Web Services (cloud: is it good for anything?)Maciej Pasternacki
 

Plus de Maciej Pasternacki (6)

A Continuous Packaging Pipeline
A Continuous Packaging PipelineA Continuous Packaging Pipeline
A Continuous Packaging Pipeline
 
Odin Authenticator
Odin AuthenticatorOdin Authenticator
Odin Authenticator
 
Why do we fail? (And how do we stop doing that?
Why do we fail? (And how do we stop doing that?Why do we fail? (And how do we stop doing that?
Why do we fail? (And how do we stop doing that?
 
Monitoringsucks
MonitoringsucksMonitoringsucks
Monitoringsucks
 
Amazon Web Services (cloud: is it good for anything?)
Amazon Web Services (cloud: is it good for anything?)Amazon Web Services (cloud: is it good for anything?)
Amazon Web Services (cloud: is it good for anything?)
 
Devops lightning talk
Devops lightning talkDevops lightning talk
Devops lightning talk
 

Dernier

React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...Karmanjay Verma
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsYoss Cohen
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Jeffrey Haguewood
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
Kuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialKuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialJoão Esperancinha
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...amber724300
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxAna-Maria Mihalceanu
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...BookNet Canada
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 

Dernier (20)

React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platforms
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
Kuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialKuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorial
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance Toolbox
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 

Test-driven development: a case study

  • 1. TDD
  • 6. More simple code, delivered faster
  • 9. Fast & precise regression discovery
  • 12. Things come together. Semantic social collaboration platform
  • 14. RDF-based APIs Graphs of linked data URIs as identifiers Subject-Predicate-Object triples
  • 15. <_:me> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> . <_:me> <http://xmlns.com/foaf/0.1/family_name> "Pasternacki" . <_:me> <http://xmlns.com/foaf/0.1/givenname> "Maciej" . <_:me> <http://xmlns.com/foaf/0.1/homepage> <http://www.pasternacki.net/> . <_:me> <http://xmlns.com/foaf/0.1/mbox> <mailto:maciej@pasternacki.net> . <_:me> <http://xmlns.com/foaf/0.1/name> "Maciej Pasternacki" . <_:me> <http://xmlns.com/foaf/0.1/nick> "japhy" . <_:me> <http://xmlns.com/foaf/0.1/workplaceHomepage> <http://www.gnowsis.com/> . @prefix : <#> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :me a foaf:Person . :me foaf:family_name "Pasternacki" . :me foaf:givenname "Maciej" . :me foaf:homepage <http://www.pasternacki.net/> . :me foaf:mbox <mailto:maciej@pasternacki.net> . :me foaf:name "Maciej Pasternacki" . :me foaf:nick "japhy" . :me foaf:workplaceHomepage <http://www.gnowsis.com/> .
  • 16. Item Relation uuid : uuid type : uri rdf_type : URI * label : string created : dateTime lastModified: dateTime Description text : string target (1) Thing Annotation Rating value : normalizedFloat InformationElement Wiki text : string Property File type : uri path : string lexicalForm : string mimeType : string ... Webpage url : string summary : string StringProperty Email subject : string value : string ... IntProperty value : integer Blogpost Tweet DatetimeProperty timestamp : dateTime author : string value : datetime author : string text : string ... ...
  • 17. def promote(self): if not hasattr(self, '_promoted'): if isinstance(self, self.get_class()): self._promoted = self else: self._promoted = getattr( self, getattr( self.get_class(), self._root_class_name + '_ptr' ).field.related_query_name() ) return self._promoted SELECT … FROM "pim_annotation" LEFT OUTER JOIN "pim_related" ON ("pim_annotation"."id" = "pim_related"."annotation_ptr_id") WHERE ( "pim_annotation"."thing_id" = E'∴' OR "pim_related"."related_to_id" = E'∴' ) ORDER BY "pim_annotation"."lastModified" DESC;
  • 18.
  • 21. “How FriendFeed uses MySQL to store schema-less data” -- http://bret.appspot.com/entry/how-friendfeed-uses-mysql
  • 22. Use PostgreSQL as RDF document- oriented database
  • 23. Single Thing class Many concrete Annotation classes TEXT field `attributes’ for free-form RDF
  • 25. Rules Keep existing code (when possible) Keep existing behaviour Keep magic localized
  • 26. I. New code RDFField & URIRefField using rdflib Customized RDF serialization
  • 27. II. Analysis Extract existing schema from model code Declare schema in RDF Glue code for attribute access to RDF data
  • 28. nfo:Bookmark rdfs:subClassOf pimo:Thing ; grfs:className "Bookmark" ; grfs:label "nfo:Bookmark" ; grfs:pluralLabel "nfo:Bookmarks" ; grfs:isGuiCreatable "true"^^xsd:boolean ; grfs:labelProperties ( dct:title rdfs:label nfo:bookmarks ) ; grfs:shortSummaryInfoProperties ( nfo:bookmarks ) . nao:description a rdfs:Property ; rdfs:domain pimo:Thing, pimo:Person, pimo:Event, nfo:Bookmark, pimo:Project, pimo:Person, nfo:FileDataObject, pimo:Topic, pimo:Location, pimo:Task, nmo:Email, pimo:Question, pimo:Organization, pimo:Note, pimo:Collection; grfs:attributeName "description" ; grfs:ftsFullText "true"^^xsd:boolean ; grfs:additionalShortSummaryInfo "false"^^xsd:boolean . nfo:bookmarks a rdfs:Property ; rdfs:domain nfo:Bookmark ; grfs:attributeName "bookmarks" ; grfs:ftsFullText "true"^^xsd:boolean ; grfs:additionalShortSummaryInfo "true"^^xsd:boolean .
  • 29. SELF_URI = URIRef('self:#') def __getattr__(self, attr): property_uri = attribute_uri(attr) oo = list(self.attributes.objects( self.SELF_URI, property_uri)) if not oo: raise AttributeError(attr) if len(oo) == 1: return oo[0].toPython() return set([o.toPython() for o in oo])
  • 30. III. Details Run test suite Find most common error Adapt test or change code Repeat for three weeks

Notes de l'éditeur

  1. \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. \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