12 Hours To Rate A Rails Application
by ehuard on Mar 27, 2010
- 3,580 views
In some situations, it's useful to be able to evaluate a Rails application quickly....
In some situations, it's useful to be able to evaluate a Rails application quickly.
I talk about how I work to get the most data as possible to get a good picture of whether an application is well-maintained, and will be easy to maintain later.
Accessibility
Categories
Upload Details
Uploaded via SlideShare as Adobe PDF
Usage Rights
© All Rights Reserved
Statistics
- Likes
- 4
- Downloads
- 31
- Comments
- 0
- Embed Views
- Views on SlideShare
- 3,520
- Total Views
- 3,580
before the sale goes through, they want to be sure they get value for money.
they call in an expert to have a look.
you are the expert.
You usually have full cooperation of the team, who would be eager for you to give a good report.
they will make an introduction
and you can observe them:
looking at people you can already form an idea
commit everything
maintainable test
broken windows
automation: manual scripts/hacks a person is not even consciously aware of
simple peer pressure in everything
the innovator: keeps up with what’s out there, wants to be on top of the next great thing
the automator: more a sysadmin profile maybe - someone who likes scripting and making everything run smoothly
the ant: obsessive-compulsive types who want to have every detail perfect.
Bottom line, after you’ve worked a while, you get a feel for what constitutes a good team. Getting to know a team can already tell you something about the application you’re about to look at ...
On a less pleasant note, some of those people will be employed by the buyer. key players in the team
does the application match the vision ?
Is it clear at all ? ‘don’t make me think’
do you manage to get pesky 500s and 404 ?
First off, what version of rails are they using ?
I think it’s a good sign when it’s a reasonably recent version.
what gems, what plugins are they using ?
Is it the last version ?
Are they popular ?
Are they maintained ?
Obviously, for commercial code, the freer the better - MIT or BSD license over GPL
some people will not trust plugins they have not written themselves.
That’s fine, but
- reinventing the wheel
- maintaining the wheel
- by releasing it, you express your confidence that it is good code.
- adoption and maintenance by others
Where would you start ?
may not be clear to you - domain-dependent
ideally googleable
sometimes internal jargon for the firm
ask someone in the same business what a term means
ask a developer what it means
Now, before continuing, there is one priority
There have been many presentations and blog posts about the subject, I’m going to try to go a little bit further, to give you an idea of what’s under the hood
Unfortunately, they don’t tell you very much: imagine you add a few lines of comment, you break up an expression into several lines - for the same code you can double the number of lines.
They give you an idea of the approximate size.
RubyParser and ParseTree are both tools developed by Kevin Clarke and Ryan Biggs
Also known as the Ruby Sadists
The idea is to navigate the abstract syntax tree =
code represented as a tree
symbolic expressions are a good way to represent this tree
list-based data structures that represent semi-structured data.
. Lisp, Scheme
the output of ruby parser and parsetree is a symbolic expression.
It gives a measure of code complexity.
For every tool I try to give first a description,
then some implementation details
and finally what is expected for good code
the AST is recursively accessed, and a calculation is made
the calculation happens with ABC
Assignment Branch Conditions - a traditional measure of code complexity.
Japanese people have this habit of taking over words that indicate new concepts
bi-ru co-hee
it’s cyclo as used by japanese people
number of linearly independent paths through a program's source code.
it’s also a measure of code complexity
split program = characters - into tokens
assignment in conditional
missing else in a case
class variables
Data clump: variables appearing together all the time - suggesting missing abstraction
feature envy: when code fragment references other object more than it references itself, or when several objects do the same kind of manipulation on a particular kind of object
Simulated polymorphism: case statements, several ifs, is_a_kind_of?
For a good test set, you need 100%, but that’s a minimum requirement.
You can have 100% coverage without
the one after that, ti change the symbol to something else
with metrics, you got to see their worst. the monster methods, the antipatterns ...
now you could also apply some normal codereading
ask them what the core is, what their best code is
At the very least it shouldn’t take too much effort to understand what’s going on.
it’s not because we use an ORM that we can drop all knowledge
in this case, it might be a good idea to reconsider. either using sql, or views at db level, or denormalize
in fact maybe we need a metric tool for views, too
divitis
javascript in the body
unindented
too much logic in view
first off, it makes sense to run them
tests take maintenance
tests are software
changes will occur, and they can be of 2 natures
if you’ve got a well-structured, well-written, modular application, you can change deployment fairly easily
they should be able to provide that, if only on a paper napkin
if what we saw up to now is ok, they will get a good report.
the following slides will get them a glowing report, with exclamation points
Are there any questions ?