Wednesday, July 13, 2022

IntelliJ and Cache: Maven Dependencies Not Resolved


This post is about the Maven dependencies not resolving.  I'm recording the incident, my understanding, and what worked for me. It can help a fellow Software Test Engineer.


Incident and its Details

I'm using the machine which has the below setup:

  • OS: Windows 10 Pro
  • IDE: IntelliJ IDEA 2022.13 (Community Edition)
  • JDK: 1.8
  • Maven: 3.5.4 

I created a new Maven project and in the pom.xml, I added the below dependencies.  The IDE showed that these dependencies are not resolved.

<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>4.3.0</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.testng/testng -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>7.3.0</version>
<scope>test</scope>
</dependency>

<!-- https://mvnrepository.com/artifact/io.github.bonigarcia/webdrivermanager -->
<dependency>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<version>4.3.1</version>
</dependency>

<!-- https://mvnrepository.com/artifact/io.rest-assured/rest-assured -->
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<version>4.4.0</version>
<scope>test</scope>
</dependency>


I observed, that the added dependencies not getting resolved, that is, not getting added to libraries.  In the IDE, I see the error as this:

  • Dependency 'io.github.bonigarcia:webdrivermanager:4.3.1' not found
  • Dependency 'org.seleniumhq.selenium:selenium-java:4.3.0' not found 
  • Dependency 'org.testng:testng:7.3.0' not found
  • Dependency 'io.rest-assured:rest-assured:4.4.0' not found

Note: I have other Maven projects to which I have added the same dependencies but of different versions, in my workspace. Each time I add a dependency it will download to the libraries in my workspace though it exists, and this is my configuration in IDE.

At this point, I did not know what is happening and how to approach resolving this problem.  All I know is, that there are other versions of the same dependencies in the Maven's library on my machine.


Understanding the Problem


I tried to understand what it is saying to me.  It says it cannot find the dependency.  Could be that it is looking for the dependency in the Maven's library on my box, and it is not finding it.  

Further, I looked into the web to see did someone else face the same incident and said behavior.  Few posts said using the "compile" scope solved the problem in their case for WebDriverManager.  But, how can the change in scope fix the dependency not found incident?  This was the question in me!  To my curiosity, I did try that for WebDriverManager; I did not see any change.


Invalidating the Cache - Is that a Fix?


In the IntelliJ IDE, I tried to invalidate the cache and reboot the IDE and open the project.  I see the dependencies being resolved and I do not see the said problem.

I don't know how this fixed the said problem here.  Also, I don't know precisely what exactly the problem is, here.  Invalidating the cache and reopening the IDE (also the project) worked.

On invalidating cache, here is what happens per IntelliJ:
  • Removes the cache files for all projects ever run in the current version of IDE
  • The files will be recreated the next time you open these projects

I remember now that I upgraded the IntelliJ to the latest version before creating the said new Maven project, here.  Later, it resulted in the above said dependency problem. 

Note that, I had created a few Maven projects using an older version of IntelliJ.  I have the same dependencies in the old and new projects, just the version of these dependencies is the only difference.

Now, invalidating the cache on this new version of IntelliJ, it got fixed.  I understand that the IDE uses the cached instances of these dependencies.  Could be there is a relationship between this cache, dependency versions, and the IDE version?  I'm technically not sure of the same, but my instincts say it is.



Saturday, June 4, 2022

Between the words Smoke and Sanity, and Test

 

Why Testing and Tests?

In simple and short, we test to have confidence in what we expect to believe or claim.  For example, I believe this code does what it is supposed to do in a context.  The tests in the testing may help to learn that and thereby help in having confidence.  Likewise, if the tests in testing are intended to prove with rational evidence that this does not work as expected -  this is also a confidence in how we see the claim.

Testing and Tests:

  • are highly contextual
  • it depends on the person who is testing
    • her/his understanding of testing and tests
    • how she/he applies the testing and tests
    • her/his thought process and ideologies on testing and tests
  • it depends on the person who is referring to the outcome of testing
  • it is highly oriented toward the expectation of the stakeholders
    • on what it has to be
    • on how it has to be
    • on what it has to serve
If there is anything in Software Development that can be tailored to the need, I see it is Software Testing.  It happens that everyone has her/his own understanding and definitions for Software Testing and how it has to be implemented and executed.  And, it is done that way!

But the same is not observed with programming, DevOps, finance, sales & marketing; or, not to the extent seen in Software Testing.  This is my observation and understanding.  Is that wrong?  That's altogether a different topic of discussion.

In the organizations, I have worked and in the projects that I have worked on within an organization, the software testing was defined and executed how they wanted it.   Though they were a few common things, how these common things were implemented and understood is not the same.



Smoke and Sanity, and Test


Before I begin, here are the questions that I would want you to answer for yourself:
  1. Would you start with Smoke Test and then start the Sanity Test?
  2. Would you continue with Sanity Test after the Smoke Test?  Why?
  3. What do you consider in Smoke Test and Sanity Test?  Anything in common?
  4. What did you learn from the outcome of the Smoke Test and Sanity Test?
  5. What did you decide and what was the next action to the outcome of the Smoke Test and Sanity Test?
  6. What was the need if you carried out Smoke Test and Sanity Test as a different testing activities?
    • How this is helping you and your stakeholders?
  7. What will you lose if you do not perform either the Smoke Test or the Sanity Test?
    • What is the cost of doing so?
  8. What is your understanding of the Smoke Test?
    • How did you establish this understanding?
    • Any update to this understanding of yours?
    • What is the coverage expected out of the Smoke Test?
  9. What is your understanding of the Sanity Test?
    • How did you establish this understanding?
    • Any update to this understanding of yours?
    • What is the coverage expected out of the Sanity Test?
  10. Do software engineers, software companies and practitioners, and engineering teams use these terms as you use?
I learn the word "Smoke Test" comes from the hardware testing context.  Then from where did the word "Sanity Test" come from?  I don't know!  

Further, I understand that the intent of these two words is the same.  That is, to have confidence in either continuing to use the build for further tests or not to use that particular build to test.


Scope and Coverage of Smoke and Sanity Tests


What comes in the scope of the "Smoke Test" or "Sanity Test" is again the question and confusion that is being carried and passed on to the generation of Software Test Engineers.  Could be this is creating a gap in understanding what it is.

Often, I have seen the scope and coverage expected out of the Smoke Test and Sanity Test are the same.  Just these two words, the Smoke Test and Sanity Test are being used interchangeably in the Software Engineering community and practice.

I could not differentiate and identify the uniqueness among them to date in my experience.  All I see is the words "test" and "testing" associate very well with any word you bring into a context. Later, everyone will define their own idea and words to it.  

If observed, the same does not happen in the other areas of software engineering.  Why?  I learn that we have kept Software Testing to be far from being technical.  This is one of the major setback reasons.



Software Testing is Technical


When I say technical, the programming is treated and accepted as technical; the DevOps is considered technical; the database administration is taken as technical.  But the software testing which overlaps with all of these engineering areas is not considered technical.

I started my software testing career in the waterfall practice days.  At times, the testing and programming teams were independent and did not interact at all. The business and project management team which got the requirement did not have interaction with testing unless for asking "can you sign off saying this be shipped.".

Today, I see the mindset of accepting software testing is technical.  In my career, over the last 7 years, I see the industry is slowly including software testing to tech excellence.  But it is yet to get its one common standards and glossary which will be used by all practitioners.

However, I see the software industry and communities yet to accept and acknowledge that people and context dynamics are also the propellers of Software Testing while it is technical.



A Solution to the Problem


When a subject and practice are considered technical, the ideas and how it is defined will also be taken seriously.  There will be no casual language when communicating the subject, work and practice.  

When I say technical, I mean it in the context of Software Engineering.  How we perceive what is technical in Software Engineering, I mean that.

I wish, this comes to Software Testing and possibly put an end to the casually used language and words.