0% found this document useful (0 votes)
50 views

How Not To Code

A look at Amazon AWS SDK's source code - and where the code fails The aim is to identify bad patterns in the code - and bugs to ensure people learns from the mistakes made.

Uploaded by

Megan Oneil
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views

How Not To Code

A look at Amazon AWS SDK's source code - and where the code fails The aim is to identify bad patterns in the code - and bugs to ensure people learns from the mistakes made.

Uploaded by

Megan Oneil
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 13

How Not To Code

A look into AWS Java SDK


Code

A Study in Java by Anonymous Face palm

From Where?
https://github.com/aws/aws-sdk-java
Official Mirror for Amazon

Expectation
Understand Amazon Code Quality
Use it as a standard mine-field to develop white box testing
skills for freshers
Not too Hard to find Issues in Source, and not as easy for
freshers
After this you should be able to reduce code and fix most of
them

equals()?

Simple Task Made to


be Too Complex!

Why can not I use


the field? Why I
need to use
getXXX() inside my
own function?
When x is Boolean, if ( x == false ) is same as if (!
x) what we are writing here?

clone()?

What does java do? Deep/Shallow Copy? Neither!


http://stackoverflow.com/questions/6182565/java-deep-copy-sh
allow-copy-clone
http://stackoverflow.com/questions/184710/what-is-the-differ
ence-between-a-deep-copy-and-a-shallow-copy

hashCode()?

Copied shamelessly from :


http://stackoverflow.com/questions/9648305/creating-a-hashcode
-method-java

Or we do not know who is whose copy?

hashCode() : II

Do they? Can they?

Show me the meaning of.

When already ::

Why on Earth?

?????

Abstract Class?

Substance Abuse?
What does a
documentation : w/o
verification means?
No Verification : EVER!!!!

How about n >


length?

Now we do not
understand if /else if
return! WOW! Wow

Javadoc's, Anyone?
What are you using
AMZN?
Eclipse?
Use something that works which increase productivity a bit,
JetBrains perhaps? See the RED ? It means error in Java Doc
In case you dont know

Yes, we understand some other people would


use it later.
But please, move to a sane IDE.

Not Sure why


Copy the beginMarker
BUT
Clone the bytes?
Hmm..
Please for ONCE, use
your OWN field Without
using a getter inside
YOUR OWN BODY!
Anyone out there?
Anyone?
.

Questions?

You might also like