Open Side Menu Go to the Top
Register
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

09-13-2016 , 03:18 PM
Quote:
Originally Posted by suzzer99
I've spent approximately 2 years teaching my dad how to copy and paste - 99% over the phone. 1 year was just learning how to select text (What does it mean when the text is blue? It won't be blue when I print right?). I think he's almost gotten it. Him having to write a 400-page book has helped accelerate the process.

Although he accidentally deleted 4 chapters and had to re-type them due to forgetting to hold down the Control key - thus replacing all his text with the letter C. Then, as far as I can tell from the post-mortem, he panicked and forget about Ctrl-Z (despite me telling him 100x to remember Ctrl-Z, and him saying "let me write this down" every time). Also he somehow closed and saved the file with only the letter C as content. And somehow he managed not to have any other copies or ever email anyone.

THEN he decided to call me (after, not before, mashing buttons right and left) in a complete and utter panic. Stressed me out to no end when I was already having a very stressful day. He even got on me for giving him the power to destroy worlds with this Ctrl-A, Ctrl-C, Ctrl-V voodoo. I told him that's why I kept telling you about Ctrl-Z and that I could just bow out of the conversation if he's going to imply I helped cause this in anyway. We tried everything to find his files - even automatic windows versioning which almost seemed to be turned on, but wasn't. In the end he re-wrote them in a few days.

I almost had him learning his way around Windows as well, and understanding what Windows Explorer is (although he still always tries to go to Internet Explorer first - great job forever confusing the olds on that one M$). But then his HD crashed and they put Windows 10 on his computer. Now he's completely lost again and I can't even help him that much because I don't have a Win 10 computer.

Love how M$ completely re-arranges everything for no good reason with each OS. I had him on Win 8 with Win 7 classic shell. I knew right where everything was.
Not that I'm a fan of M$, but nothing you mentioned has changed in Windows 10 in terms of keyboard shortcuts and their built in OS search is pretty good so if you're looking for something just have your dad type in Start > Search. It's activated by default. Much closer UI experience to 7 in windows 10 as well, compared to 8 any way.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-13-2016 , 03:25 PM
Again, you are giving my Dad way too much credit to have any idea what to search for. He has no idea what the Control Panel is or how to use it. I think he sort of understands the concept of files and folders, but it's shaky at best. He just knows he has icons that he clicks for his internet, his open office, etc. Then inside open office he clicks File->Open and it magically finds his documents folder. If it opens somewhere else he's lost. Most all the other menu items are hieroglyphics to him.

He still struggles mightily with copying files from one place to another and understanding that his "data traveler" (the brand name I guess of the first USB drive he ever bought) is also a USB drive, and a thumb drive, and whatever else people call it just to confuse him.

I don't think he gets yet that when he has multiple files open in Open Office, and switches between them, he's not closing one thing and opening another. Same goes for programs. Which probably stems from not understanding the relationship/role between a file and a program. This problem led to the great chapter-delete catastrophe. Seems like Win 10 has confused him again by combining the open program windows on the task bar or something. Also he doesn't know how to google for any computer issues, and I can't get him to try it despite all my urging.

Also I always get the speech about how he's right-brained not left-brained, and he can write a super complex poem, but this stuff is hard for him. Yes Dad, I know - you tell me that every time we do this within 5 minutes. But again, I'm not asking you to write The Wasteland. I'm asking you to do the computer equivalent of a Jack and Jill poem.

That said his attitude has gotten better lately, and his retention is improving along with it. I did get him Win 10 for "senior" dummies. Which he seems to like and wasn't offended. I got him regular Win 10 for dummies first and it was too intimidating.


Last edited by suzzer99; 09-13-2016 at 03:32 PM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-13-2016 , 03:36 PM
I got my Dad a $500 point-and-shoot digital camera setup a few years back when they were still pretty pricey. He signed up for a class to learn how to use it. But then didn't go because "it was raining". Ok. He ended up giving it away to his friend who always helped him on the computer. Then the friend promptly moved away.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-13-2016 , 03:48 PM
Suzzer my recommendation for search was for your claim you didn't know where anything was anymore when helping him.

Sent from my SM-G900R4 using Tapatalk
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-13-2016 , 04:02 PM
Yeah I think I've used that a little. But it doesn't help me explain to him how to see what open windows he has in open office, when apparently his task bar open items are gone.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-13-2016 , 05:10 PM
I bought my mom a gps once because she likes to go places, but gets lost and then gets anxious about going places.

She literally didn't open it for a year because she thought it would be complicated. She waited for me to visit and have time to "show her how to use it"

I said, ok, let's do it. She takes it out of the box, plugs it in, presses a button and starts typing in an address. Naturally, it works fine. She was like, "oh, I just thought it would be hard"

In my secret thoughts I hope that this is just because she and I are different kinds of people, and not because being old is sort of hard, because I would really prefer to not be as out of the mainstream tech-wise as my parents are.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-13-2016 , 05:13 PM
Oh man, I was IMing with a friend of mine's mom once, and first of all, her IMs are all "Dear Rusty, ..." followed by paragraphs, then she hits send and walks away from the computer for 3 days.

But this particular time she was hitting enter a lot and her message was like
Hi, do you know where
Lee got that book you liked
I'd like to get it
for my nephew
or something like that. I asked her about that and she said that if she typed any more than that the words would "go off the screen"

Her chat window was, you know, partially not visible. I had to walk her through moving a window including things like "what is a window", "what is a mouse cursor", "what does click and drag" mean and so forth. All the while she could only communicate a few words at a time.

She is a very sweet lady, but oh lord.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-13-2016 , 05:20 PM
Sounds like my Dad's kindred spirit.

Btw I'm the exact same as my Dad, my knowledge base is just much higher to begin. I hate learning new stuff. I buy new gadgets and they sit in the box for months. Getting music onto an iPod ruins my mood for hours. (f-kin itunes)

Obviously I have to fight against this impulse for my job, also because learning new things keeps your brain young. But I hate that totally lost figuring things out part. It hurts my brain. Once I get over that hump of having no idea what I'm doing, then the fun part begins where I can play with the tools I understand and start to build and refine things.

I'm not sure I will ever be much of a tinkerer. At my new job there seems to be two standard roles: 1. political self-promoter powerpoint architect or 2. tinkerer who's perfectly happy to spend months playing around with stuff that will almost certainly never see production. Both of those are very unsatisfying to me.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-13-2016 , 05:33 PM
Its just the way olds are. My father started playing pokemongo and I of course was dinking around with it for a few days like everyone else. We get together and I'm like "are you hatching your eggs?" and he says "no I don't know how to do that" so I start telling him how and he cuts me off and thrusts his phone at me and says "do it for me". I of course um decline. He still plays constantly somehow and I wonder if he's ever even done the gym stuff or even evolved... apparently throwing balls at random monsters is fascinating.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-13-2016 , 05:37 PM
Your father playing pokemon go is like top 2% of tech-savvy dads. My dad didn't have email about 2007 or so. He has a cel phone but it's a burner he only uses in emergencies. My ex-stepdad never had anything other than a home phone. He finally broke down and got an answering machine in the 2000s at some point.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-13-2016 , 06:15 PM
Man, making creative answering machine outgoing messages was part of the fun of being a kid in the whenever I grew ups
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-13-2016 , 06:57 PM
Quote:
Originally Posted by RustyBrooks
Oh man, I was IMing with a friend of mine's mom once, and first of all, her IMs are all "Dear Rusty, ..." followed by paragraphs, then she hits send and walks away from the computer for 3 days.

But this particular time she was hitting enter a lot and her message was like
Hi, do you know where
Lee got that book you liked
I'd like to get it
for my nephew
or something like that. I asked her about that and she said that if she typed any more than that the words would "go off the screen"

Her chat window was, you know, partially not visible. I had to walk her through moving a window including things like "what is a window", "what is a mouse cursor", "what does click and drag" mean and so forth. All the while she could only communicate a few words at a time.

She is a very sweet lady, but oh lord.
this is awesome, both parts of the story.

what's funny is i find all these lol-old-people-and-tech stories incredibly charming. like, laugh all you want, but on some level they all just don't give a **** enough, which is cool in a way that's simply impossible to be when one spends energy tweaking the settings of an app or being excited about whatever lame feature is finally being released in the next OS update.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-13-2016 , 07:02 PM
suzzer, wasnt your dad like 30 or 40 in the late 90s when the tech boom and internet happened? I mean, that sht happened a long time ago and even olds should be pretty well acquainted with it.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-13-2016 , 07:03 PM
My Dad is 77.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-13-2016 , 07:08 PM
my dad is in his early 60s and very up to speed on all of the new tech. he wasnt super geeky but we got a computer and did america online in 94 like everyone else. he reinvented himself from a (mechanical) tech writer to some sort of tester at some point in the mid 2000s. he even wrote a bit of javascript for one of his jobs.

the crazy thing is that my mom is like the tech lead of the english department at the university she teaches at and she is like really bad about understanding how computers work. like, she has her way of doing things, and even if its massively inefficient, or dangerous, like refusing to use ctrl-c or whatever, she refuses to change. and yet, shes the teacher for this stuff.

the thing that tilts me the most is that she incessantly double clicks everything. she double clicks internet links ffs. this is a relic from way back in the day when the internet wasnt ubiquitous and like 90% of the operations on windows required a double click i think.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-13-2016 , 10:00 PM
Has anyone here used an API speccing language to automatically test their endpoints? Like, RAML, swagger, API blueprint, etc?

I'm using RAML but they all seem more or less the same I guess

The problem I'm running into is, at this point, that many endpoints won't function without well-prepared data, because they are either querying the database to get the data, or they're modifying it in some way or deleting it.

Is the standard solution to run these tests against a pre-defined database?

My 2nd question is that all the RAML testing stuff I've found just verifies that your endpoint returns one of the status codes it is specced to return, and that it's return validates against the provided schema. It doesn't really have any hooks for, for example, "correctness". I am wondering if someone can point me towards something where you use the RAML spec, plus some glue, to make tests. Something where you can sort of script a set of actions like
* create Foo1
* create Foo2
* query and verify that Foo1 and Foo2 are returned
* modify Foo1
* query and verify Foo1 changed as it should
* delete Foo2
* query and verify Foo2 is deleted
and so forth.

Really what I'm thinking of is providing a set of urls+post bodies+expected returns and having it run through them, verifying each one. I actually wrote something very much like this myself but I was asked to use a "standard" mechanism and we settled as a company on RAML.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-13-2016 , 10:02 PM
(and to be a bit clearer I would like all the post bodies / expected returns to come from the examples I'm providing in my RAML spec. This way I not only know my API at least kinda works but I know that the examples that are automatically provided in the docs DO work)
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-13-2016 , 11:12 PM
I've been using swagger. I have a testDB module that pre-populates my local database every in dev mode, and deletes everything and pre-poluates it again between each test. I use the data models to make pre-population easier.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-14-2016 , 12:25 AM
Quote:
Originally Posted by RustyBrooks
Has anyone here used an API speccing language to automatically test their endpoints? Like, RAML, swagger, API blueprint, etc?

I'm using RAML but they all seem more or less the same I guess

The problem I'm running into is, at this point, that many endpoints won't function without well-prepared data, because they are either querying the database to get the data, or they're modifying it in some way or deleting it.

Is the standard solution to run these tests against a pre-defined database?

My 2nd question is that all the RAML testing stuff I've found just verifies that your endpoint returns one of the status codes it is specced to return, and that it's return validates against the provided schema. It doesn't really have any hooks for, for example, "correctness". I am wondering if someone can point me towards something where you use the RAML spec, plus some glue, to make tests. Something where you can sort of script a set of actions like
* create Foo1
* create Foo2
* query and verify that Foo1 and Foo2 are returned
* modify Foo1
* query and verify Foo1 changed as it should
* delete Foo2
* query and verify Foo2 is deleted
and so forth.

Really what I'm thinking of is providing a set of urls+post bodies+expected returns and having it run through them, verifying each one. I actually wrote something very much like this myself but I was asked to use a "standard" mechanism and we settled as a company on RAML.
yes, use a test database with canned data. depending on how you write your queries, you may be able to use an in memory one with changing any of the code.

here's some example tests of what you're describing using supertest, but not RAML:
Code:
  describe('POST /sessions', function() {

    it('prevents access when not logged in', async function() {
      await request.get('/protected').expect(401);
    });

    it('rejects a login with bad credentials', async function() {
      await request.post('/sessions')
        .send({email: 'bad', password: 'bad'})
        .expect(401);
    });

    it('allows access after login', async function() {

      await request.post('/sessions')
        .send({email: 'test@m.com', password: 'secret'})
        .expect(201);

      await request.get('/protected').expect(200);
    });
  });
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-14-2016 , 09:29 AM
This RAML thing is going to be a pain in the ass. I'm documenting endpoints I didn't write, and that honestly I don't even know very much about. Several of these are really just turning around, calling another service, and returning that result. A lot of these have complex unknown data structures, like this:
https://gist.github.com/rustybrooks/...0eb73576275e92
(there are at least 2 dozen endpoints like this, that return a fat blob of crap, none of which I know much about)

Since we just turn around and call another API, I am thinking about mocking out that call in our test server. Is that crazy? Otherwise my tests can fail if the results are different (which they could be) or if they fail temporarily, or if they change their format, etc. What a mess.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-14-2016 , 09:30 AM
It probably goes without saying, but, also, there is zero documentation of any kind.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-14-2016 , 10:55 AM
rewrite it all
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-14-2016 , 11:30 AM
Quote:
Originally Posted by RustyBrooks
Since we just turn around and call another API, I am thinking about mocking out that call in our test server. Is that crazy? Otherwise my tests can fail if the results are different (which they could be) or if they fail temporarily, or if they change their format, etc. What a mess.
In an ideal world you need both sets of tests (component tests and integration tests) but if you could only do one, it depends on what you think the API's implied contract is. If you think the API's contract is to forward the request and transform the result or whatever, then you need to test that behavior and also the API should be wired in such a way that the destination is configurable. If on the other hand the API's contract is to return the desired result and that it relies on another API is an implementation detail (that could potentially be changed), then testing that behavior is more important. The more unpredictable you think the destination API's behavior is, the more you should lean towards the former.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-14-2016 , 01:17 PM
Testing is like working out imo. Just writing some tests is 75% of the battle, no matter what your philosophy.

We're writing cucumber tests. Not sure if I would have chosen that, but it was started before I got there so I make it work. They look like this:

Code:
Feature: Agent Detail

  Returns a list of available release conditions and basic details for a given Agent

  Use agentUserId = id1 to see a result
  
  Background:
    Given The agent list is populated in the test DB
   
  @dev
  Scenario: I invoke the agent/detail service path
    When I GET from http://localhost:10010/api/agent/detail/"id1"
    Then I should match the JSON dummy data for public agent details with id "id1"  

  # id not found
  @dev
  Scenario: I invoke the agent/detail service path
    When I GET from http://localhost:10010/api/agent/detail/"bad_id"    
    Then I should see the response key,code,status: "AGENT_NOT_FOUND,3,404"

  # id not found
  @dev
  Scenario: I invoke the agent/detail service path
    When I GET from http://localhost:10010/api/agent/detail/"duplicate_ids"    
    Then I should see the response key,code,status: "DUPLICATE_AGENTS,3,404"
And the thing that actually drives the test looks like this:

Code:
'use strict';
const request = require('supertest');

(function() {

  module.exports = function () {
    
    const lib = require(dclfLibRequire);

    this.When(/^I GET from http:\/\/localhost:(\d+)\/api\/agent\/detail\/"([^"]*)"$/, function(port, agentUserId, callback) {
      const self = this;
      
      if (agentUserId === 'duplicate_ids') {
        agentUserId = 'id1';
        lib.config.dal.tables.agentAgent
          .insert(lib.config.dal.testDb.agentListDummyData[0]) // add a duplicate agent
          .run((err, response) => {
            getResponse(callback);
          });
      }
      else {
        getResponse(callback);
      }

      function getResponse(cb) {
        request('http://localhost:' + port)
          .get('/api/agent/detail/' + agentUserId + '')
          .set('Accept', 'application/json')
          .set('Content-Type', 'application/json')
          .end((err,res) => {
            if (err) {
              console.log(err);
              callback('Error ' + err);
            } 
            else {
              self.body = res.body;
              self.statusCode = res.statusCode;
              callback();
            }
          });
        }
    });
  
    this.Then(/^I should match the JSON dummy data for public agent details with id "([^"]*)"$/, function (agentId, callback) {
      const testAgent = lib.config.dal.testDb.simulateDetailResponse(agentId);
      
      if (this.compareJson(testAgent)) callback();
      else callback('Invalid response, body=' + JSON.stringify(this.body));
    });
  };
})();
I've got like 150 tests now for a pretty simple API.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
09-14-2016 , 02:24 PM
We have a ****load of tests, that's not really what I'm asking about.

What I want is tests that are either generated directly from the API description/documentation, or generated from it with very little directed input. The reason for this should be obvious: documentation is practically useless if it isn't enforced, and if it can't be automatically enforced, it won't be.

You can use tools like, for example, "abao" to do very basic RAML testing. It'll go through your RAML doc, call every API endpoint that it can with the given example, and verify that the return matches the expected schema.

That's actually not a bad start except that it does not check the return for correctness aside from it having the right form, i.e. matching the schema. But your API could return the correct form and still have bugs. Like say you had a delete function that returned the right data but didn't actually delete anything.

So I'd like some way to write "stories", i.e. a sequence of API events and the outcomes that should be expected. I had sort of hoped that some doc languages did this, but none that I have seen does. (My prototype did, but, like I said, they want something standard.)

I'm still looking for a tool that will let me do this with minimum hassle.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m