Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!

Jorge Ruiz-Aquino

Ranch Hand
+ Follow
since Sep 25, 2017
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jorge Ruiz-Aquino

There is a link to the contents where you can find the chapters:

These chapters are not included as free samples but for answering your question, yes, the book covers those topics.
Although not specific, I would say that the chapters 9 & 12 cover part of the topic "integrating testing in a corporate environment with other existing tools".
But I'm sure Lucas da Costa would respond this questions better.
Lucas da Costa congrats for your book!
This is one of the awkward interesting questions.

I was reviewing the available contents in Manning's site. I noticed that several concepts are similar to general testing, like the atomicity, assertions, mocks, stubs.

So, apart from libraries or tools?
How the concepts of testing JavaScript applications  differ from testing other languages (let say Java)?


Junilu Lacar wrote:As a newbie on a real-world project, you should have been told that Copy/Paste programming is grounds for immediate termination of employment.
Seriously though, stop making this OK just because you're a newbie. This should be Lesson #1 on Day #1 : Copy/Paste coding, BAD! BAD PROGRAMMER!

so true and funny.

Junilu Lacar wrote:I think you meant "peer reviews" but "pair reviews" works, too, if you were referring to the instant code reviews that pair programming affords you.

Yes, my bad. I meant peer review. I updated my comment.

Junilu Lacar wrote:More than likely the average "experienced guy" in large corporate settings ... has practically little to no experience in refactoring or unit testing.

I'm in a large corporate (no-unicorn). So, I plenty agree with you.

Junilu Lacar wrote:I'd bet that if you brought up this Five Lines of Code to your lead developer, there's a good chance you'll get a strange "WTF you talkin' about?" look back.

Challenge accepted.  

Junilu Lacar wrote:larger scale refactoring efforts that require their own "tickets" (ugh) should be reserved for legacy code that you have to maintain.

Junilu Lacar wrote:People with less design/development experience will have a less keen sense of "smell"... You won't refactor something that doesn't smell to you...

I agree with these.
Let's say, there is a legacy-like system with newbie folks working on it making a combination of factors causing more code that need to be refactored.
Newbie folks tend to c&p existing blocks of code to replicate some logic ending with tons of code duplication.
Also they tend even to replicate the old friends "hundreds" and "thousands-lines-method".
However, here is where the "peer reviews" come handy. Hoping that the experienced guy have in mind good practices and the sense of "code smell".

Thank you for these insights from you both.
Hi Christian,

How do you approach code refactoring in real world?
Do you do iterations? What do you refactor first and what later?

There are many recommendations of what to refactor and how, but not a guide of how to push the overall effort.

Thank you Christian,

It makes sense to me.
Although I was pointing out the code duplication I do really like your approach to the rest of the code. It also makes sense to a lot of the code in our system.
I hope I can join at today's streaming.
Christian Clausen, maybe a better example would be the snippet I posted in the thread Algorithm to eliminate code duplication where there is a code duplication in order to process remaining data, however that duplication could be avoided by adding one more counter and check in one single block of code.
Thank you Campbell Ritchie.

The refactor is not about one specific method, but the logic from Listing 1.
My goal is to make a proposal for my project managers in order to stop doing C&P of that logic for processing by chunks.
Legacy code from 2000's. No refactor applied.
“You will see still greater abominations that they commit.”  

The goal of the first counter is to count up to 20K (the chunk).
The second counter is to make sure to process the remaining data if less than 20K.
Hi Christian,

Congrats on your new book.

Lets say we have a Java method to process data by chunks of 20K. Listing 1.
I want to refactor by using the logic in Listing 2. (I prefer not to use recursion)

My questions:
- Do you or anyone knows if the algorithm in Listing 2 was given a name?
- From refactorization guru point of view, what would be your recommendation to eliminate this code duplication?

Listing 1. Code Duplication

Listing 2. Refactorization. The difference is totalCounter == paramArray.length
Yes, I was talking about Web browsers.
And I was asking about Mobile capabilities like camera, contacts, compass, accelerator, and so on.

Got the answer.
Thank you!
Thanks for that clear answer.

Then I guess I have to have more knowledge about the different Internet navigators capabilities like responsiveness.
Do you explain in your book what mobile capabilities are possible from the Internet navigators?

Hi John,

If I know how to build traditional Web Apps. What other technologies are recommended to learn in order to tackle Progressive Web apps?
Let's say, I know how to work with HTML, JS, CSS, a back-end programming language and I know how to deploy to a Web App Server.

Hi John,

When should we consider to build a Progressive Web App?
It's convenient to build one in replacement of an existent mobile application?

Thanks and Congrats on your new book!
Those are great advises.
Thank you Marco Faella and Campbell Ritchie.