Software Quality in PHP? - PHP · 2018-10-31 · Software Quality in PHP? PHP.RUHR Tobias Schlitt ...

Preview:

Citation preview

Software Quality in PHP?PHP.RUHR

Tobias Schlitt <toby@qafoo.com>2014-10-02

About me

I Tobias Schlitt <toby@qafoo.com>I Degree in computer sienceI Proessional PHP since 2000I Consultant / Trainer at Qafoo

http://qafoo.com

Known as PHP

Known as PHP

Known as PHP

Quality Breakdown

Project Lifetime

Time toBugfix /Feature

BusinessValue

Table of Contents

PHP Architecture

Clean PHP Code

Testing

Operations

Conclusion

Outline

PHP Architecture

Clean PHP Code

Testing

Operations

Conclusion

HTTP by Design

Client

Application

Storage

HTTP

HTTP

LoadBalancer

Cache

HTTP

LoadBalancer

Cache

HTTP

HTTP

HTTP

HTTP by Design

Embraces SOA Architecture

I REpresentational State Transfer (REST)I Micro Service Architectures

Micro Service Architectures

Authentication Product Catalog

Shop Frontend

Product UpdaterExternal Shop

Queue

HTTP HTTP

HTTPHTTP

Useful Links

I http://qafoo.com/resources/presentations/international_php_conference_se_2013/pragmatic_

rest.html

I https://www.ics.uci.edu/˜fielding/pubs/dissertation/top.htm

I https://www.ietf.org/rfc/rfc2616.txt

Web-scale Architecture

I MySQL bound to PHPs DNAI Support by Oracle for enterprise customers

I CouchDBI RedisI RabbitMQI BeanstalkI elasticsearchI . . .

Useful Links

I https://couchdb.apache.org/

I http://redis.io/

I http://www.rabbitmq.com/

I https://kr.github.io/beanstalkd/

I http://www.elasticsearch.org/

Standard Components / Frameworks

2

Useful Links

I http://symfony.com/

I http://framework.zend.com/

I https://getcomposer.org

Outline

PHP Architecture

Clean PHP Code

Testing

Operations

Conclusion

Clean PHP Code

I PSR-x standardizationI Clean CodeI SOLIDI RefactoringI Domain Driven DesignI Agility

Useful Links

I http://qafoo.com/resources/presentations/phpbenelux_2014/refactoring_with_patterns.html

I http://qafoo.com/resources/presentations/symfonycon_warsaw_2013/decoupling_with_domain_

events.html

I http://qafoo.com/resources/presentations/phpbenelux_2013/make_your_project_solid!.html

I http://qafoo.com/resources/presentations/confoo_ca_2013/designing_beautiful_apis.html

I http://manifesto.softwarecraftsmanship.org/

Software Metrics

I MeasurableI ObjectiveI ReproducableI Automated

ANDC

AHH

NOPNOC

NOMLOC

CYCLO

NOMCALLS

FANOUT319

652

686

4384410

30127

0.439

0.397

4.2333.228

10.6930.156 0.489

1.59

Generated by PDependLow Average High

0.1 0.2 0.60.50.40.3 0.80.7 1.00.90.0

0.1

0.2

0.6

0.5

0.4

0.3

0.8

0.7

1.0

0.9

0.0

Abstraction

Instability

Generated by PDepend

Useful Links

I http://qafoo.com/resources/presentations/confoo_ca_2013/understand_and_use_software_

metrics.html

I http://qafoo.com/blog/027_code_review_tool.html

I http://pdepend.org/

I http://phpmd.org/

Outline

PHP Architecture

Clean PHP Code

Testing

Operations

Conclusion

Double Feedback Test Cycle

Project Owner

FailingAcceptance

Test

DeveloperFailing

Unit-Test

Make TestPass

Refactor

Make TestPass

Useful Links

I http://qafoo.com/blog/055_finding_the_right_test_mix.html

I http://qafoo.com/blog/051_testing_sweet_spot.html

I http://qafoo.com/resources/presentations/dutch_php_conference_2014/behave_behavior_driven_

development.html

I http:

//qafoo.com/resources/presentations/confoo_ca_2013/building_testable_php_applications.html

I https://phpunit.de/

I http://docs.behat.org/en/latest/

Performance / Monitoring

Useful Links

I http://qa.fo/profiler

I http://qafoo.com/blog/071_testing_micro_services.html

I http://qafoo.com/resources/presentations/researchgate_developer_day_2013/continuous_

performance_testing.html

I https://metrics.librato.com/

Outline

PHP Architecture

Clean PHP Code

Testing

Operations

Conclusion

Operations

Production Staging Development

Operations

Production Staging Development

Automation

Virtual Machine

Automation

I System SetupI OrchestrationI ConfigurationI DeploymentI Setup

Useful Links

I http://qafoo.com/blog/065_infrastructure_automation.html

I http://abc.tools.qafoo.com/

I http://qafoo.com/resources/presentations/international_php_conference_2011/vom_lokalen_

build_zum_deployment.html

I http://www.vagrantup.com/

I http://ansible.com/

Outline

PHP Architecture

Clean PHP Code

Testing

Operations

Conclusion

Dev-Ops!

Development Quality

Assurance

Operations

DevOps

Why should I care

I ScalabilityI ExtensibilityI MaintainabilityI ReliabilityI Rapidity

Q/A

Questions?

I Tobias SchlittI <toby@qafoo.com>I http://qafoo.com

I Slides already onlineI http://qa.fo/phpruhr14

I Usefull links included

Recommended