SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 41 of 41
  1. #26
    SitePoint Enthusiast
    Join Date
    Nov 2005
    Location
    The Netherlands
    Posts
    84
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow, Trac really looks good. Love it already. Thanks crashmakerMX.

  2. #27
    ********* Victim lastcraft's Avatar
    Join Date
    Apr 2003
    Location
    London
    Posts
    2,423
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi...

    Quote Originally Posted by x4t
    First of all, I'm not all that keen on this quote "but the security stuff usually comes after the basic application idea is up" You kind of get that MS stuff in XP, bad security because it's a layer around the application, not something that's actually build into the application.
    There is nothing to stop you adding a feature, securing it, adding another feature, securing it, and so on. Unfortunately a project with no features is already secure, so it's a bit difficult to make it more secure . You need at least one feature.

    Actually Security has a different methodology to developing applications. It's more like code inspection and static analysis, combined with hiring consultants and tiger team testing.

    Quote Originally Posted by x4t
    I could go with an other feature, let's say, template parsing. (If that's okay with you. Else, name your feature )
    That's still techy, internal stuff. If you were to describe to a normal person (which rules out programmers) what your web site/app. does, what would you say?

    Quote Originally Posted by x4t
    It's going to be a site for people who can share their home-made work to get a bit more renown. (And then, this is for a specific group I don't want to mention here because of the uniqueness (is that a word? ) of the idea.)
    Is this unique work just files? Do you need file viewers so that the content can be seen on-line? Does the content need to be edited on-line? A wiki allows shared work, all be it for text only.

    OK, I'll punt and assume it's some kind of file sharing thingy. Let's say the user can register a project with a description once registered. We'll go back and add registration later. How about this for a story...?

    1) A user with no projects can create a new one with the "Add project" link.
    2) Successfully adding a project takes them back to their log in landing page.
    3) Any projects that the user owns appear when they log in.

    Here is a test...
    PHP Code:
    class TestOfAddingProjects extends WebTestCase {
        function 
    testAddingFirstProjectMakesItVisible() {
            
    $this->get('http://localhost/secret_project/');
            
    $this->setField('username''Me');
            
    $this->setField('password''Shh!');
            
    $this->click('Log In');
            
    $this->assertNoText('First Project');
            
    $this->click('Add project');
            
    $this->setField('title''First Project');
            
    $this->setField('description''Just a test project');
            
    $this->click('Add');
            
    $this->assertText('First Project');
            
    $this->assertText('Just a test project');
        }

    Is this realistic? Is this the correct URL structure? We don't have to be certain, as we can change our minds later. I am assuming that there is a hard coded test user at the moment. We'll fix that later, but right now we want to make core progress.

    Here are my steps to get the tests passing (I'm not running these, so there wil be lot's of little errors).

    First we need a home page with a log-in. Say "index.php"...
    PHP Code:
    <?php
        
    if (@$_POST['s'] == 'Log in') {
            
    header('Location: portal.php');
            exit();
        }
    ?><html>
        <form method="post">
            <input type="text" name="u" />
            <input type="password" name="p" />
            <input type="submit" name="s" value="Log in" />
        </form>
    </html>
    This is the absolute minimum needed to get to the bit we are actually testing.

    Then we need the "portal.php" page...
    PHP Code:
    <html>
        <
    a href="add_project.php">Add project</a>
    </
    html
    Which naturally leads to "add_project.php"...
    PHP Code:
    <?php
        
    require_once(dirname(__FILE__) . '../project_repository.php');

        if (@
    $_POST['s'] == 'Add') {
            if (@
    $_POST['t'] && @$_POST['d']) {
                
    $repository = new ProjectRepository();
                
    $repository->create($_POST['t'], $_POST['d']);
                
    $repository->save();
                
    header('Location: portal.php');
                exit();
            }
        }
    ?><html>
        <form method="post">
            <input type="text" name="t" />
            <input type="text" name="d" />
            <input type="submit" name="s" value="Add" />
        </form>
    </html>
    This in turn forces "project_repository.php"...
    PHP Code:
    class ProjectRepository {
        function 
    create($title$description);
        function 
    save();

    That's all we need to do to for the test right now. Back to "portal.php"...
    PHP Code:
    <?php
        
    require_once(dirname(__FILE__) . '../project_repository.php');

        
    $repository = new ProjectRepository();
        
    $projects $repository->findAll();
    ?><html>
        <a href="add_project.php">Add project</a>
        <p>
            <?php while ($project $projects->next()) { ?>
                <h2><?php print $project->getTitle(); ?></h2>
                <em><?php print $project->getDescription(); ?></em>
            <?php ?>
        </p>
    </html>
    At this point we have a failed acceptance test. The top level code is working. OK, it won't win any coding prizes right now, but it is roughly working (allowing for all the silly things I've forgotten). You could walk away from the code now, come back a year later and figure out where you were.

    The next step is to shift to unit tests and write some tests for the ProjectRepository. I don't want to go any further though unless you think I'm on the right track.

    yours, Marcus
    Marcus Baker
    Testing: SimpleTest, Cgreen, Fakemail
    Other: Phemto dependency injector
    Books: PHP in Action, 97 things

  3. #28
    SitePoint Enthusiast
    Join Date
    Nov 2005
    Location
    The Netherlands
    Posts
    84
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There is nothing to stop you adding a feature, securing it, adding another feature, securing it, and so on. Unfortunately a project with no features is already secure, so it's a bit difficult to make it more secure . You need at least one feature.
    I saw this from the wrong angle

    That's still techy, internal stuff. If you were to describe to a normal person (which rules out programmers) what your web site/app. does, what would you say.
    You're right, it's hard to describe to a normal user, but it would be something like this.
    "A template parser is a class (a set of functions working together to achieve a goal) used to keep the markup of the site split from the actual code that runs te site".

    Is this unique work just files? Do you need file viewers so that the content can be seen on-line? Does the content need to be edited on-line? A wiki allows shared work, all be it for text only.

    OK, I'll punt and assume it's some kind of file sharing thingy. Let's say the user can register a project with a description once registered. We'll go back and add registration later. How about this for a story...?
    I don't think it is necessary for the example that SP knows what kind of files they are

    The next step is to shift to unit tests and write some tests for the ProjectRepository. I don't want to go any further though unless you think I'm on the right track.
    You are very much on the right track Marcus This is kind of the idea I want to implement to the site.

    Thank you for your time and effort you've already put into this.

    yours, Martijn
    Last edited by x4t; Apr 2, 2006 at 11:34.

  4. #29
    SitePoint Zealot Mau's Avatar
    Join Date
    Jan 2006
    Location
    California, USA
    Posts
    134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I get this feeling a lot. The key I've found is to only start when you have a few hours to devote to it in one sitting. Once you get the basic framework and design setup, I usually get motivated. The hard part is starting, but once you have started, it's easy to get going.

  5. #30
    SitePoint Enthusiast
    Join Date
    Sep 2005
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i'm in agreement with 'lolol' on breaking things down into short term, attainable goals. i myself use a to-do list, which is constantly being re-written and modified. with each little change you make, your confidence will grow. this is helped by following testing principles (i use simpletest personally) which will give you even more confidence in knowing that not only have you successfully developed a piece of code, but that it is also more robust than it might be had you not used testing first.

  6. #31
    l 0 l silver trophybronze trophy lo0ol's Avatar
    Join Date
    Aug 2002
    Location
    Palo Alto
    Posts
    5,329
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by smithie
    i'm in agreement with 'lolol' on breaking things down into short term, attainable goals.
    :|

  7. #32
    SitePoint Enthusiast
    Join Date
    Nov 2005
    Location
    The Netherlands
    Posts
    84
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi lastcraft,

    do you still want to finish your example? (For I'm still strugling along with TDD).

    yours, Martijn

  8. #33
    ********* Victim lastcraft's Avatar
    Join Date
    Apr 2003
    Location
    London
    Posts
    2,423
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi...

    Sure. So is my example currently on the right track?

    yours, Marcus
    Marcus Baker
    Testing: SimpleTest, Cgreen, Fakemail
    Other: Phemto dependency injector
    Books: PHP in Action, 97 things

  9. #34
    SitePoint Enthusiast
    Join Date
    Nov 2005
    Location
    The Netherlands
    Posts
    84
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by lastcraft
    Hi...

    Sure. So is my example currently on the right track?

    yours, Marcus
    Hi..

    Yes, your example is on the right track, as I said a few posts earlier

    yours, Martijn

  10. #35
    ********* Victim lastcraft's Avatar
    Join Date
    Apr 2003
    Location
    London
    Posts
    2,423
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi...

    Quote Originally Posted by x4t
    Yes, your example is on the right track, as I said a few posts earlier
    Oh, yeah . Missed that.

    OK, next step is to get the project repository up and running. We had this so far...
    PHP Code:
    <?php
    class ProjectRepository {
        function 
    create($title$description) {
        }

        function 
    findAll() {
        }

        function 
    save() {
        }
    }
    ?>
    The basic problem is that this class has to be able to persistently create projects. That's a big test to do in one go, so I'll first test that we can even create a project...
    PHP Code:
    <?php
    require_once(dirname(__FILE__) . '../classes/project_repository.php');

    class 
    TestOfProjectRepository extends UnitTestCase {

        function 
    testProjectCanBeCreated() {
            
    $repository = new ProjectRepository('A''aaa');
            
    $this->assertEqual($repository->create(), new Project('A''aaa'));
        }
    }
    ?>
    This doesn't just fail, it crashes. I'll add the project class to the same file...
    PHP Code:
    class ProjectRepository { ... }

    class 
    Project {
        function 
    __construct($title$description) {
        }

    ...and add only the bare minimum to the repository...
    PHP Code:
    class ProjectRepository {
        function 
    create($title$description) {
            return new 
    Project($title$description);
        }
        ...

    This should give us a passing test. The real test is this...
    PHP Code:
    class TestOfProjectRepository extends UnitTestCase {

        function 
    testProjectCanBeCreated() { ... }

        function 
    testProjectIsPersisted() {
            
    $repository = new ProjectRepository();
            
    $repository->create('A''a project');
            
    $repository->save();

            
    $repository = new ProjectRepository();
            
    $all $repository->findAll();
            
    $project $all->next();
            
    $this->assertEqual($all->next(), new Project('A''a project'));
        }

    That gets us into saving stuff to the database. If you have a DB connection object already, or use a library, now would be a good time to tell me....

    yours, Marcus
    Marcus Baker
    Testing: SimpleTest, Cgreen, Fakemail
    Other: Phemto dependency injector
    Books: PHP in Action, 97 things

  11. #36
    SitePoint Evangelist dmsuperman's Avatar
    Join Date
    Feb 2005
    Location
    A box
    Posts
    516
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Honestly I can't program very well without music playing in the background, spend a little time getting a gig or so of music and make yourself a nice playlist. Open up notepad and your playlist, begin playing, and see if you're motivated then
    <(^.^<) \(^.^\) (^.^) (/^.^)/ (>^.^)>
    Core 2 Duo E8400 clocked @ 3.375GHz, 2x2GB 800MHz DDR2 RAM
    5x SATA drives totalling 2.5TB, 7900GS KO, 6600GT

  12. #37
    SitePoint Enthusiast
    Join Date
    Nov 2005
    Location
    The Netherlands
    Posts
    84
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by lastcraft
    Hi...



    Oh, yeah . Missed that.

    OK, next step is to get the project repository up and running. We had this so far...

    [code]


    That gets us into saving stuff to the database. If you have a DB connection object already, or use a library, now would be a good time to tell me....

    yours, Marcus
    Hi..

    Looking good, the example The goal/idea of TDD slowly dawns on me now I don't have any code atm, so no database objects or librarys.

    @dmsuperman: Sometimes I play music, sometimes not. It doesn't matter really.

    yours, Martijn

  13. #38
    SitePoint Guru Galo's Avatar
    Join Date
    May 2005
    Location
    Holland!
    Posts
    852
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I get myself motivated by writing specifications for the project, then dividing it into goals, setting up the todo-list and fire off from the top down, if something is not working or takes me to long i try and find another solution to save me some endless hairpulling.
    Business as usual is off the menu folks, ...

  14. #39
    ********* Victim lastcraft's Avatar
    Join Date
    Apr 2003
    Location
    London
    Posts
    2,423
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi...

    Quote Originally Posted by Galo
    I get myself motivated by writing specifications for the project, then dividing it into goals, setting up the todo-list and fire off from the top down, if something is not working or takes me to long i try and find another solution to save me some endless hairpulling.
    I would be interested in hearing other people's thoughts on this. I find a big planning exercise a demotivator. Everyone gets together, discovers potential problems, adds their personal wants and then the enormity of the project hits them a few days later. how many projects get abandoned a few days after the planning exercise with nothing to show?

    I spend a lot of time trying to deliver the smallest project possible whilst keeping a few options open. It also means the requirements gathering exercise with a small feature set is much smaller - hours instead of days. They at least have some hope in hell of being correct, and when they are not, at least it's been less damaging.

    I am not saying that this story is universal. I'd like to know if others find planning motivational or demotivational. I you could add your Myers-Briggs type as well, taht would be cool .

    yours, Marcus
    Marcus Baker
    Testing: SimpleTest, Cgreen, Fakemail
    Other: Phemto dependency injector
    Books: PHP in Action, 97 things

  15. #40
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    UK
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by lastcraft
    Hi...
    I would be interested in hearing other people's thoughts on this....

    yours, Marcus
    I never feel the need to write out a full specification. Once I have received and reviewed a spec/request from the client I meet with them and ask them to 'talk' me through what they need and how the envisage it working. While they are explaining I ask lots of questions (that I generally already know then answer too) to make sure they understand the project and haven't missed off any small details that they may take for granted. I record everything so once I start developing I can refer to my audio files to clear anything up.

    As I build each module/section I create a small spec / to do list but nothing too major

    Depending on the size of the project I might meet and have this chat with the client more then once, after every milestone for example.

    This has worked succesfully for me so far.

    Edit: At the moment I'm a single developer, I'll have to change my approach when/if I recruit.

  16. #41
    is_empty(2); foofoonet's Avatar
    Join Date
    Mar 2006
    Posts
    1,000
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    iNTJ

    Most clients have a reasonable idea of what they want.

    I talk with the client and try and during that conversation, almost in chat, extract what would make the biggest differences to their job/function (call them "higher goals")- though do not generally document those things, but rather help them focus on achieving what they think was their original goal - thier original spec.

    I then usually model how I see the information fitting together (to make sure I can do it). Then I extrapolate and do some blue sky thinking on how else the model could be extended to include the "other unimaginables" that would bridge between what the client originally spec'd and how I can see how it might help them achieve the "higher goals".

    I then protoype the data model, and add examples of "higher goals", go back to the client and present these potential extra benefits (they are always there, and are generally accepted, and built upon).

    There is no motivational problems from thereon in, because I have seen and shared a dream with someone, and by God its ****ing important to then deliver on the promise.

    What starts off as a spec ends up as a shared goal. They feel empowered because they are designing something new, I feel empowered because I feel as though I have some autonomy - and am heading into my own kind of "self realisation".

    Then I eat their liver.

    (Amusingly I just found out other iNTJ's include Hanibal Lecter )test yourself


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •