Showing posts with label XP. Show all posts
Showing posts with label XP. Show all posts

06 April 2014

Cool Software Things Volume I


Continuos Refactoring

Refactoring is touching the code , when it starts to smell. Long story short summary, your code starts to smell when it has duplications, long method names, long parameter lists, bloodless objects or objects which has more than one responsibility or methods more than one task or parameters has more than one meaning. Addition to that you cannot have message chain with so-called object orientence with so many delegations. And Don't forget Your code should be the documentation and documentation should be your code so writing comments are something bad, your code should be self explanatory and not require comments to explain how implementation is working.(Excluding commenting on interface. comments on interfaces are explaining the contract.). You may need refactoring if your code has one of those and here is How to do it? Answer 1, Answer 2
refactoring should be a continuos activity as you grow your product. Adding a new fix, adding a new feature, adding a new test should trigger refactoring request.

Right Software Methodology

So far I have been in the organisations applying Waterfall, SDLC, Agile. I believe software methodology is key interface in implementing software management. However What I observe is implementing software methodology is also quite important as selecting them. Companies should be aware taking the methodology as a template and applying to their own way of workings. I strongly believe In the wrong implementation of Agile you can end up with having less productive team than a flexible waterfall team. Methodology you choose should be lightweight, and you should not dictate the methodology by repeating terms and philosophy like a parrot all the time. This should be consumed naturally. The way you apply and needing should be the common sense.
For a brand new organisation my advise would be to apply the procedure below;
1. pick NONE.
2. continue working
3. struggle for a certain issue,
(you will definitely see people crying on certain things)
(your people will cry differently than the others, so don't copy paste)
4. search for an agile practice
5. apply the found practice or create a new one together
6. return 2


Delete Code

Comparing the test done, (unit test, integration test, black box test, white box test, functional test, verification test, production test, customer acceptance test) and code written, it is obvious that written code is only a small fraction of the all tests done. Moreover to that, we are observing that only small piece of the code written is actually working. Most of the code is over-designed for some never happening future feature requirement, or afraid to touch because it is not understandable.
When we bring all this together , I believe deleting code is a very valid skill. if you see things over engineered than sooner or later you will end up having your code smell. But if you think a piece of software is unnecessary but somehow that part is tight to another code or not necessary at all , than question it. This will save considerable amount of unit testing time and let other developers save their time to focus on the valid part when trying to understand the code or maintaining it.



Next: Api Design, But, Extending Runtime, Ramp up fast, Immutability, Water, Smallest thing that works


23 August 2007

Refactoring

Refactoring
----------------

Refactoring is a Cornerstone in Extreme Programming.
But It is a Topic one should deal with it, regardless of his interest on XP.
I will introduce issue of refactoring with Martin Fowlers very precious intro.
After This I will go on telling about What Refactoring is by giving examples.




Refactoring is the process of changing a software system in such a way that it does not alter
the external behavior of the code yet improves its internal structure. It is a disciplined way to
clean up code that minimizes the chances of introducing bugs. In essence when you refactor
you are improving the design of the code after it has been written.
"Improving the design after it has been written." That's an odd turn of phrase. In our current
understanding of software development we believe that we design and then we code. A good
design comes first, and the coding comes second. Over time the code will be modified, and
the integrity of the system, its structure according to that design, gradually fades. The code
slowly sinks from engineering to hacking.
Refactoring is the opposite of this practice. With refactoring you can take a bad design, chaos
even, and rework it into well-designed code. Each step is simple, even simplistic. You move
a field from one class to another, pull some code out of a method to make into its own
method, and push some code up or down a hierarchy. Yet the cumulative effect of these
small changes can radically improve the design. It is the exact reverse of the normal notion
of software decay.
With refactoring you find the balance of work changes. You find that design, rather than
occurring all up front, occurs continuously during development. You learn from building the
system how to improve the design. The resulting interaction leads to a program with a design
that stays good as development continues.

17 August 2007

Pair Programming



This is not a joke. Two developers should look at the code at the same time. There is one driver role and one observer role. Driver writes and observer observes the code.
One of them can not touch the code if other does not exist.
Driver and observer role have to be changed in a day. (This will produce more readable code.)

Pair Programming is a XP discipline.
It should be handled in 3 ways.

1) Motivation to this discipline
2) Source Usage
3) Result

I talk with one of the managers of Avrupa YAZILIM which uses XP in their software development process.
He said that, at the beginning, it is hard to motivate our developers to concentrate on pair programming.
And after 5 or 6 months, they feel very comfortable with working in pairs such that they are jocking as i can't write without my pair :)

When you look at source usage you can say that one task is done by two employees and this removes quality of source usage.
It has been proven that: if we say solution of defect on development process has cost 1 unit of job, defect catched on test results with 3 units of cost,
(since tester will loose time to catch this defect, and after you fix she will again test it, and you will debug to find errored line) defect that is catched on production results with 40 units of job. Operation, loosen prestige of company, customer, reverse test process, redevelopment, loose of courage , etc ..

In Pair Programming it is harder to make error, since both of your developers should make same error in the same time. This is really hard if pair programming is applied well.

How to apply Pair Programming well? :)

ok , Both of your employees in a pair should be in same level.
If you are thinking as "this is experienced developer and we should put an in-experienced one next to him." You lack of everything. You don't understand what xp is?
XP does not aim to grow people, It only and only aims to finish the goal. Need will be succeed as the customer requires in that time. Not more, not less. Simple.

Therefore if you have in-experienced pair they should be given more usual, straightforward tasks.

I haven't got published article on that but, it is said that, while one developers productivity and performance is %40 with pair programming it rises up to %115 ..
This brilliant note given to me by XP manager.


XP pairs should be changed. But this change should be consistent with the level of employees. One ten year programmer, cannot write program with the one, starts his work life yesterday.

Immediate reasons :
1)New guy will slow old guy.
2)Old guy will fly on code, new guy does not understand anything.
3)New guy will not have the capacity to debug and correct the old guys errors
4)New guy (Source), w,ll be garbage and cannot take the driver role from old guy.
5)Old guy will have one more role, Teach to new comer what he does...
...
..

Pairs will change among the project life cycle , this change will force Collective Code Ownership. Information Change.

Note: I know you are asking how new one learn?

Don't forget. I wrote this in my previous posts.
XP should not be mixed with agile strategies.
XP is special method and it needs special requirements.

Stess , Tension , Limeted time , un-determined customer needs, changing requirements.
These conditions are the ones what XP wants.
If you have straightforward stuff you do not need to apply XP and don't apply it :)
Then you can grow your guy :)

09 August 2007

12 Extreme Programming Rules

I The Planning Game: Meet with coders, managers and the customer each week to schedule tasks for the next phase. Update the plan regularly.

II Small Releases: Put a simple system into production quickly, then release new versions on a short cycle.

III Metaphor: Create an analogy that expresses how the parts of the new system work.

IV Simple design: Design simply and remove complexity at every stage.

V Testing: Write test programs that assure every portion of the code runs flawlessly before attempting a new task.

VI Refactoring: Edit the code to simplify, add flexibility, or remove redundancy.

VII Pair Programming: Write all code with two programmers at one machine.

VIIICollective Ownership: Permit anyone on the team to change code anywhere in the system at any time.

IX Continuous Integration: Bring components of the program together several times throughout each day to make sure they work in concert.

X 40-Hour Week:
Strive to work no more than 40 hours a week. Never work overtime a second week in a row.

XI Onsite Customer: Include a real, live user on the team, available full-time to answer questions.

XIICoding Standa-rds:
Use agreed-upon styles and nomenclature to promote easy understanding of what the code does.

4 Parts To Extreme

Planning

User stories are written.
Release planning creates the schedule.
Make frequent small releases.
The Project Velocity is measured.
The project is divided into iterations.
Iteration planning starts each iteration.
Move people around.
A stand-up meeting starts each day.
Fix XP when it breaks.

Designing

Simplicity.
Choose a system metaphor.
Use CRC cards for design sessions.
Create spike solutions to reduce risk.
No functionality is added early.
Refactor whenever and wherever possible.

Coding

The customer is always available.
Code must be written to agreed standards.
Code the unit test first.
All production code is pair programmed.
Only one pair integrates code at a time.
Integrate often.
Use collective code ownership.
Leave optimization till last.
No overtime.

Testing

All code must have unit tests.
All code must pass all unit tests before it can be released.
When a bug is found tests are created.
Acceptance tests are run often and the score is published.

31 July 2007

STAND UP MEETINGS

One of the extreme programming rule: You have to stand up @ stand up meetings. :D
This is must for each project morning.

Team members come together every morning. And make 5-10 min. long meeting.
This is a must. In this meeting people talk about their old task(about yesterday)
and talk about new tasks(today)
Head and team members should be motivated to keep meeting short.
So key is: STAND UP. :)



During the meeting you are not allowed to sit. Reason is simple and logical :)
You suffer while stuff talking about their task since you are standing up.
Therefore will require to sit down asap so you will keep your task summary
as short as possible. If there is an issue which cause meeting to go long.
This issue is taken to cards and new meeting in day is assigned related to this job.
A responsible emloyee(s) is determined about this work.

XP approach forms via 12 Software Engineering best practices.
This is one of them. It sounds different and enjoyable.
It should be tested :)

25 July 2007

Do the simplest thing that could possibly work

Yes. This is there . eXtreme Programming Motta. :)
Extreme Programming is a methodolgy or a perspective in software Engineering.
I am planning to write between 10 to 20 posts about this topic.
I will identify this issue for my lovely readers.
It depends on simplicity and Communication. And this results with Courage.
I think title summarizes definition of simplicity.

XP states this logic: Deliver the software needed. (emphasizes on the needed one, more than the needed is garbage)
Don't think as, these feature may be needed in the future lets add it also.
Simplicity is the basic step of the XP building.

XP has outstanding methods. I will post about these methods later on.
But i will state here what communication means.
Developer to Developer, Developer to Customer, Developer to Tester, Tester to Customer
Each unit is contact with each other. And customer is also belongs to XP team.
Customer has to work elbow to elbow with developer.
This is must. Iterations procedures inside Project involves Customer. Customer should be involved becaouse Doc. is not strict so much. and Development Processes starts with Customer histories.

XP is suitable for project which customer needs are abstract and not determined.
In other words if your customer needs are changing and if it is a high tension project and it needs short period of time. We can define this project as a XP project.

ok. I know. it seems not logical right now.
Wait my following posts.
I will Shift+Delete Question Marks on your head. :)

See you later.
Happy. :)