SlideShare a Scribd company logo
Technology
for
reduce of mistakes
id:karupaneura
YAPC::Asia 2015 #yapcasiaD
Oops.. I forgot AC adaptor..
Thank you very very much!!!!
Hello, YAPC::Asia!!
About me
• Kenta SATO (id:karupanerura)
• Perl/XS/Swift/Kotlin/Java/Crystal/C99/etc..
• Gotanda.pm Author
• Senior Engineer at Mobile Factory, Inc.
• WebApp/iOS/Android/Operation/etc..
CPAN (PAUSE: KARUPA)
• Time::Strptime
• Geo::Hex::V3::XS
• Test::SharedObject
• Plack::App::Vhost
• etc..
Gotanda.pm #6
• at 9/17(Tue) GaiaX Inc.
• Join us!
• http://gotanda.pm.org/
YAPC::Asia with me
• 2011: LT (My first attend to YAPC::Asia)
• 2012: LT + Individual Sponsor
• 2013: 20min Talk + individual sponsor
• 2014: 40min Talk + individual sponsor + volunteer staff
• 2015: 60min Talk + individual sponsor + core staff
• 2016: ???
Summary of this talk
Summary of the talk
• About of human error. (human factors)
• How to reduce human error?
• The hint for reducing of human error factors
• by technology/technic
Agenda
1. Human Error
2. How to notice human error factors?
3. How to reduce factors by engineering?
4. Approaches by engineering
5. Conclusion
Human Error
We need safe code
• Don’t want to crash application
• Don’t want to mistake the code operation
• Don’t want to destroy data
• Don’t want to break code when modified
What is human error?
Human error ≒ mistake
Human error is …
• The word of human factors field
• David Meister defined:
• “a deviations from
the requested performance by system.”
• source: “Human factors: theory and practice”
POINT: Human error is …
• In our context: operator = another developer
• It’s defined in a operator’s context
• Engineers create a system and operate it
ourself.
• So we should think that a developer and a
operator are different person.
POINT: Human error is …
• “System” means …
• a infrastructure
• a application
• a source code
• etc…
Why happen a human error?
Factor of human error
• grouping by factor:
• Human factor
• Management factor
• Environment factor
Human factors
• Direct factor:
• A carelessness
• A mistake
Approach for
human factors
• Control arousal level
• Pointing confirmation
• Accident prediction training
• NKY Training
Management factors
• Indirect factor:
• Not enough direction
• Not enough review
Approach for
management factors
• Work flow improvements
• Simplification of proces
• Code review
• Documentation
• Automation
Environment factors
• Indirect factor:
• Difficult to understand
• Complex ways
• Tend to overlook a mistake
• Tend to make mistakes
Approach for
environment factors
• Make it easy to understand
• Simple ways
• Tend to notice a mistake
• Prevent/Safe a mistake
CONCLUSION of this section
• Human error ≒ mistake
• Think in another developer's point of view
• Is it difficult to understand?
• Are there complex ways?
• Is it be tend to overlook a mistake?
Agenda
1. Human Error
2. How to notice human error factors?
3. How to reduce factors by engineering?
4. Approaches by engineering
5. Conclusion
How to notice
mistake factors?
near-miss
• In Japanese “ヒヤリ・ハット”
• Accidents that cause no loss/injuries/damage
Heinrich's law
“that in a workplace, for every one major injury
accident there are 29 accidents that cause
minor injuries and 300 accidents that cause no
injuries (what are often termed “incidents”),
roughly a 1-30-300 proportioning.”
Heinrich's law
serious accident
slight accident
near-miss
frequency
POINT: Heinrich's law
A mistake factor makes many near-misses
Be careful near-miss!
• Tend to overlook
• because not loss/injuries/damages
• Resolving near-misses prevents incidents
How to find
near-misses factors?
Collect
the case of near-misses
How to collect
the case of near-misses?
Technology for reduce of mistakes - うっかりをなくす技術
Github issue is awesome
• Tag is awesome
• CRITICAL/LITE/ARCH/CODE/etc..
• Engineer friendly
• Easy to link with code
Code review
• Get a operator points of view
• Find a factor of near-miss
• Create issue soon
• Analyze and fix it
CONCLUSION of this section
• Resolving near-misses prevents incidents
• Should collect the case of near-misses
• GitHub issue is good
• Code review is good approach
• for finding a factor of near-misses
Agenda
1. Human Error
2. How to notice human error factors?
3. How to reduce factors by engineering?
4. Approaches by engineering
5. Conclusion
How to reduce
mistake factors
by engineering?
Environment factors
can be reduced
by engineering
How to reduce
environment factors?
Approaches
• Easy to understand
• Simple ways
• Tend to notice a mistake
• Prevent/Safe a mistake
break..
Agenda
1. Human Error
2. How to notice human error factors?
3. How to reduce factors by engineering?
4. Approaches by engineering
5. Conclusion
Approachs by engineering
Easy to understand
Easy to understand
• Readable code
• Descriptive naming
• Code document/comment
• Less side effects
Readable code
• Read it!!!!!!!!!!!!!
Readable code
READ
IT
SOON
Descriptive naming
帰れま10
Descriptive naming
Descriptive naming
Descriptive naming
Code document/comment
• This does know you(developer) only!
• ”Why this approach is used?"
• "Why this workaround is needed?"
• etc..
• But, Operator needs this information.
Less side effects
• No any side effects is best.
• But, we uses ...
• database
• view
• and ...
Less side effects
• Approach:
• (Don't use global variable)
• Shorten object lifecycle
• Immutable(Readonly) object/value
• Functional programming
Shorten object lifecycle
• Less status changes reduces side effects
• Object has statuses
• Make object in a minimum of scope
e.g. Sledge::Plugin::Stash
Immutable object/value
• Immutable object don't have any statuses
• It reduces side effects
• No logic depend on mutable status
• It makes many side effects in many cases
• Immutable object makes immutable status
Immutable object/value
• Immutable variable:
• Swift:let / Java:final / Kotlin:val / Scala:val
• Perl: (Library makes readonly value)
• Readonly.pm/Const.pm
• Internals::SvREADONLY
Immutable object/value
• Immutable object:
• Value object pattern
Functional programming
• This is one approach for that the status is
closed in minimal scope
• The status is closed in function
• The side effect is close in monad
• (But, I don’t know too much this field.)
Simple ways
Simple ways
• Immutable object/value
• Shallow nested code
• Modularization
Shallow nested code
• Don't write deeply nested code
• Deeply nested code has many statuses
• It’s not simple
• Solution: structured programming
• Split code to other function
Modularization
• Operation of the procedure should be a
simple.
• Operator need High-Level API
• Practice structured programming
Tend to notice a mistake
Tend to notice a mistake
• Type restriction/checking
• strict.pm / warnings.pm (Perl)
• Static code analysis (Perl::Critic/Perl::Lint)
• Optional
• Assertion
• Automated test
Type restriction
// Java
package org.yapcasia.app;
public class DB {
public Prepare select (Query query) {
// …
}
}
Type checking
## Perl
use Smart::Args;
sub select {
args my $class => ‘ClassName’,
my $sql => ‘FooDBI::Query’;
…
}
What's the good point of
type restrict/checking?
• Checks type at compile-time or run-time
• Notices that type is incorrect
• When type is incorrect
• Operator probably made a mistake
strict.pm
## Perl (no strict.pm)
$foo = 1; # it pass
## Perl (enabled strict.pm)
use strict;
$foo = 1; # compile time error
# my $foo = 1; # *MUST* declare `my` variable
# $foo = 2; # can use declared variable *ONLY*
What's the good point of
strict.pm?
• Notices the typo at compile-time
• Difficult to use is a bad way in strict mode
• e.g.) soft reference
• SEE ALSO: perldoc strict
warnings.pm
## Perl (no warnings.pm)
my $answer = ‘3:’ + 2; # => 5 (!?)
## Perl (enabled warnings.pm)
use warnings;
my $answer = ‘3:’ + 2; # => 5 (!?)
# WARN: Argument "3:" isn't numeric in addition (+) at …
What's the good point of
warnings.pm?
• Notices the incompatible implicit type
conversion at run-time
• and some warnings are available
• SEE ALSO: perldoc warnings
Static code analysis
• Finds popular mistakes.
• in Perl: Perl::Critic/Perl::Lint
• in JavaScript: ESLint/JSLint/JSHint/etc..
• in Java: FindBugs/etc..
• in Swift: (I’m needing it, but not found yet..)
Optional
// Swift
var foo : Int? = someNilableLogic()
if let notNilFoo : Int = foo {
// notNilFoo is not null
}
println(“(foo + 1)”) // it makes compile-time error
What's the good point of
Optional
• Ensures the safety of access to nullable value
• in compile-time
• not need to check null manually
• Maybe monad can also be used as well
• .. maybe :p
Assertion
/*** C ***/
int i = 1;
i = add(i, 2);
assert(i == 3); /* abort when `add` is broken */
What's the good point of
Assertion
• Prerequisites becomes clear
• Notices when the precondition is lost
• in run-time
• C++11: static_assert
• checks assertion at compile-time
Automated test
• No explanation needed :)
Prevent/Safe a mistake
Prevent/Safe a mistake
• defer, guard object, try-with-resources
• Max reqs per child
• Poka-yoke
defer
// Swift 2.0 (XXX: not checked yet)
let fd = open(filename, O_RDONLY)
defer { close(fd) }
…
// Go
fh, err := os.Open(filename)
if err != nil {
panic(err)
}
defer f.Close()
guard object
## Perl
use Guard;
my $sock = IO::Socket::INET->new(…);
my $guard = guard { close($sock) };
…
try-with-resources
## Java7
try (FileReader r = new FileReader(filename)) {
// …
}
What's the good point of
defer, guard object?
• Auto release the resources
• at appropriate timing
• in appropriate scope
• not need to release the resources manually
Max reqs par child
• “Limit on the number of requests that an
individual child server will handle during its
life” (Apache)
• When the memory leak occurs
• The problem is reduced
Poka-yoke
• In Japanese “ポカヨケ”
• The gimmick prevents mistake physically
• Example: Operator need shutdown a server
• When that the target server is used:
• Cannot shutdown
CONCLUSION of this section
• There is engineering approaches for
• notice/reduce/prevent near-misses
• run-time check is good
• compile-time check is very good
• Static typing language is awesome
Agenda
1. Human Error
2. How to notice human error factors?
3. How to reduce factors by engineering?
4. Approaches by engineering
5. Conclusion
CONCLUSION
Conclusion
• Think in another developer's point of view
• “Is it easy to understand?”, “Is it simple?”
• Resolving near-misses prevents incidents
• Should store the case of near-misses
• GitHub issue is good
Conclusion
• Good approach:
• Easy to understand
• Simple ways
• Tend to notice a mistake
• Prevent/Safe a mistake
TMTOWTDI :)
Let’s find
the new safety approach!
Please vote me!
Thank you for listening
Any questions?

More Related Content

PPTX
Scaled Agile Framework Roadmap Template
PDF
初めてのPerl 〜つぶやいてないでコード書け〜
KEY
Introduction to Padrino
KEY
Irb Tips and Tricks
PPTX
Go for Rubyists. August 2018. RUG-B Meetup
KEY
正月発火村に参加して変なJobQueueサーバー作った話
PDF
First step of Performance Tuning
PDF
オープンデータを利用したWebアプリ開発
Scaled Agile Framework Roadmap Template
初めてのPerl 〜つぶやいてないでコード書け〜
Introduction to Padrino
Irb Tips and Tricks
Go for Rubyists. August 2018. RUG-B Meetup
正月発火村に参加して変なJobQueueサーバー作った話
First step of Performance Tuning
オープンデータを利用したWebアプリ開発

Viewers also liked (20)

PDF
メールフォームからメールを送る近代的な方法 | YAPC::Kansai 2017 OSAKA
ODP
Chibapm1
PDF
東京近郊のPerlコミュニティのご紹介 #lcs2015
PPTX
障害を防ぎ、サービスを守るために #gotandapm
PDF
The Many Facets of Apache Solr - Yonik Seeley
KEY
Teng tips
PDF
Mojolicious::Liteを使ってみよう
PDF
dwangocpp1-lt
PDF
Why we use mruby with Perl5?
PDF
Mojoliciousでつくる! Webアプリ入門
PDF
Okinawapm#3
PDF
engineer-life
PDF
若手Itエンジニア飲み会-LT
PDF
ぼくがかんがえたさいきょうのMvc
PDF
今年作ったもの2013 #hokkaidopm
PDF
Hokkaido.pmの未来
PDF
Hokkaido.pm #11
PDF
運用とデータ分析の遠くて近い関係、ISUCONを添えて
PPT
Airworthiness: Maintenance Error Dirty Dozen
PDF
Perl RDBMS Programming(DBI/DBIx::Sunnyのはなし)
メールフォームからメールを送る近代的な方法 | YAPC::Kansai 2017 OSAKA
Chibapm1
東京近郊のPerlコミュニティのご紹介 #lcs2015
障害を防ぎ、サービスを守るために #gotandapm
The Many Facets of Apache Solr - Yonik Seeley
Teng tips
Mojolicious::Liteを使ってみよう
dwangocpp1-lt
Why we use mruby with Perl5?
Mojoliciousでつくる! Webアプリ入門
Okinawapm#3
engineer-life
若手Itエンジニア飲み会-LT
ぼくがかんがえたさいきょうのMvc
今年作ったもの2013 #hokkaidopm
Hokkaido.pmの未来
Hokkaido.pm #11
運用とデータ分析の遠くて近い関係、ISUCONを添えて
Airworthiness: Maintenance Error Dirty Dozen
Perl RDBMS Programming(DBI/DBIx::Sunnyのはなし)
Ad

Similar to Technology for reduce of mistakes - うっかりをなくす技術 (20)

DOCX
NDSU CSCI 717Software ConstructionDefensive Programming.docx
PPTX
Fundamental Principles of Software Development
PPTX
Human Error Prevention
PPTX
Good code
PPTX
1606125427-week8.pptx
PDF
Exception handling
PPTX
Human Error Prevention
PDF
Fault Tolerance 101
KEY
Enforcing Behavioral Constraints in Evolving Aspect-Oriented Programs
PDF
Poka yoke
PDF
Poka yoke
PPTX
Computational thinking
PPTX
RTS fault tolerance, Reliability evaluation
PPTX
real time systems fault tolerance, Redundancy
PPT
Dependable Software Development in Software Engineering SE18
PDF
The Uncertainty Principle
PPTX
LOW LEVEL DESIGN INSPECTION SECURE CODING
PDF
The Open Closed Principle - Part 1 - The Original Version
PDF
Exception+Logging=Diagnostics 2011
PDF
Machine Learning Operations Active Failures, Latent Conditions
NDSU CSCI 717Software ConstructionDefensive Programming.docx
Fundamental Principles of Software Development
Human Error Prevention
Good code
1606125427-week8.pptx
Exception handling
Human Error Prevention
Fault Tolerance 101
Enforcing Behavioral Constraints in Evolving Aspect-Oriented Programs
Poka yoke
Poka yoke
Computational thinking
RTS fault tolerance, Reliability evaluation
real time systems fault tolerance, Redundancy
Dependable Software Development in Software Engineering SE18
The Uncertainty Principle
LOW LEVEL DESIGN INSPECTION SECURE CODING
The Open Closed Principle - Part 1 - The Original Version
Exception+Logging=Diagnostics 2011
Machine Learning Operations Active Failures, Latent Conditions
Ad

More from karupanerura (20)

PDF
Perl5 VS JSON
PDF
コンテキストと仲良く
PDF
The plan of Aniki 2.0
PDF
Aniki::Internal
PDF
The Crystal language *recently* update
PDF
KOWAZA for mackerel
PPTX
TIme::Moment+Time::Strptime=
PPTX
DateTimeX::Moment
PDF
Aniki has come
PDF
Optimize perl5 code for perfomance freaks
PDF
router-simple.cr
PDF
はかたの塩
PDF
Gotanda.pmの紹介
PDF
すいすいSwift
PDF
Perlにおけるclass実装パターン
PDF
モジュール開発におけるぼくの試行錯誤
PDF
Aniki - The ORM as our great brother.
PDF
Perl5 meta programming
PDF
mysqlcasual6-next-key-lock
PDF
Hachioji.pm #40
Perl5 VS JSON
コンテキストと仲良く
The plan of Aniki 2.0
Aniki::Internal
The Crystal language *recently* update
KOWAZA for mackerel
TIme::Moment+Time::Strptime=
DateTimeX::Moment
Aniki has come
Optimize perl5 code for perfomance freaks
router-simple.cr
はかたの塩
Gotanda.pmの紹介
すいすいSwift
Perlにおけるclass実装パターン
モジュール開発におけるぼくの試行錯誤
Aniki - The ORM as our great brother.
Perl5 meta programming
mysqlcasual6-next-key-lock
Hachioji.pm #40

Recently uploaded (20)

PDF
Encapsulation theory and applications.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Machine Learning_overview_presentation.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Cloud computing and distributed systems.
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPT
Teaching material agriculture food technology
Encapsulation theory and applications.pdf
Programs and apps: productivity, graphics, security and other tools
Machine Learning_overview_presentation.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Diabetes mellitus diagnosis method based random forest with bat algorithm
A comparative analysis of optical character recognition models for extracting...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
20250228 LYD VKU AI Blended-Learning.pptx
Approach and Philosophy of On baking technology
Building Integrated photovoltaic BIPV_UPV.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Electronic commerce courselecture one. Pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Cloud computing and distributed systems.
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
Assigned Numbers - 2025 - Bluetooth® Document
Teaching material agriculture food technology

Technology for reduce of mistakes - うっかりをなくす技術