Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1erpdh-000752-GS for pgadmin-hackers@arkaria.postgresql.org; Fri, 02 Mar 2018 18:42:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1erpdg-0008Bs-D9 for pgadmin-hackers@arkaria.postgresql.org; Fri, 02 Mar 2018 18:42:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1erpdg-0008Bh-3i for pgadmin-hackers@lists.postgresql.org; Fri, 02 Mar 2018 18:42:40 +0000 Received: from mail-io0-x233.google.com ([2607:f8b0:4001:c06::233]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1erpda-0000nt-OI for pgadmin-hackers@postgresql.org; Fri, 02 Mar 2018 18:42:39 +0000 Received: by mail-io0-x233.google.com with SMTP id l12so11570420ioc.10 for ; Fri, 02 Mar 2018 10:42:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pivotal-io.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AuqAReDOa+rLROGSAR4so4dW7aJGvlj4QzPXBHU0H6Y=; b=lGDZEmzDmgrR9gXQIuHz/giYd0XDBuE9faEykWOVlhwM1UhrC1cFGX49nx1DH6Z8LE DTiQo1iMVjaijD5NEWQlI6f0eM7qd35uncLjJFsFog5Xy+h5+oNWWV1rs0oFUfDo5JSQ NcCtypSA7tx884E8Vp5w/t1oBD3YdTr88KjZp5tacc/zGdmqdZUUZArBVU/ydXPvRAfO HDZqvpyIFuLrmOwqBmWoTzepp7Il/QOe5jzQy/CZHUa5jm8xAbvZN7b+upeHSYki3oY1 U5QFHsUpkRMn0N0UN5iO+PtKBiKypFMf9mxuIzZvpj1YxskTKvdhXGVLAIpUtQwkacLd eP0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AuqAReDOa+rLROGSAR4so4dW7aJGvlj4QzPXBHU0H6Y=; b=pONskmz/zUqbhrQYyOMpqvRLICnNupwyv8/Sortif2v2ZO8RPsZmxUmEA/Pp+8LhTt j3RYpOwd4V+WCgBM0S4LYBaH7ErUJGa0tIndVEA9/VYnp6VaFetDFmfRPc+ctT8b1OrF FmjOzHHaobvTVzfdmeButxh3r6E3kSadBX/6WWxqQK5LuykPMk9/mkpa6k6xTC2THYqz sgN5//IMYIGYw73xxzqYT8vOKtsNe6i+M2V3DNtrtpfd2Q7/Yev4kXCodPaDl2CRnKSL jvKO4kLbfkwV7pglYZ39s53HCRW+VVSY+Vt4efNS1L+JxJ1+WjetY9p2IDq+FrJfWUkJ tocA== X-Gm-Message-State: AElRT7FrNXlavSpeBrtrjuAD6t9KlFRcE/wyygpHSUj1CLc4d5kIlzYW 0F+j0ula49DHP+W8G2NtUoVjI36Szi+nLsQHDBJf0w== X-Google-Smtp-Source: AG47ELvqZ2gNUTbZCz1FdGAEeh8JnxW7pQAO31zstyAtONEI4uR67pE+MniPoS8uCwH79/u4QUNuRKVVtywNUvY+Lbo= X-Received: by 10.107.39.5 with SMTP id n5mr7640787ion.189.1520016152000; Fri, 02 Mar 2018 10:42:32 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Joao De Almeida Pereira Date: Fri, 02 Mar 2018 18:42:21 +0000 Message-ID: Subject: Re: pgAdmin 4 commit: Ensure we pick up the messages from the current query To: Dave Page Cc: Khushboo Vashi , Murtuza Zabuawala , pgadmin-hackers Content-Type: multipart/alternative; boundary="001a11406f18cb30b205667256c5" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --001a11406f18cb30b205667256c5 Content-Type: text/plain; charset="UTF-8" Hello Dave, Very well said, I didn't intended to say that Feature Tests are not important, what I was saying is that when we can do faster and more thorough tests we should take it. All the tests that we do are important to ensure that the software we produce is of good quality. Also the higher you go in the pyramid the more volatile the test are and more variables need to be taken into account when doing them. Thanks Joao On Fri, Mar 2, 2018 at 8:31 AM Dave Page wrote: > On Thu, Mar 1, 2018 at 3:21 PM, Joao De Almeida Pereira < > jdealmeidapereira@pivotal.io> wrote: > >> Hello Khushboo, >> > The patch runs successfully in our CI with all tests passing. >> >> I see the test that you created, and I do not understand why we need to >> create tests that do HTTP requests in order to check something that is >> executed against the database. What I was talking about in my previous >> email was having tests that tested the function by itself. >> >> >> (Copied from: >> https://jfiaffe.files.wordpress.com/2014/09/tests-pyramid.png) >> >> This is the Testing Pyramid, there are a bunch of different drawings of >> it and ways to explain it, but in broad stokes what is means is that we >> should have the majority of tests around a Unit (that are some >> disagreements in the community of what a Unit is) and a very small amount >> of Manual testing. What Unit usually means is piece of code, it can be a >> function, it can be a class or it can even be a module, but is something >> self contained. In pgAdmin's case the majority of our tests go around the >> Integration Layer because we are using HTTP requests in order to executing >> queries in the database, so basically we are doing tests end to end in the >> backend, and the cost time. >> >> I do not want to held this patch back because of this, and I say this >> because I have minimal confidence with the tests that you created, that >> they would catch the majority of the problems, and hope that the majority >> of the code is exercised by it. >> >> Nevertheless I would like to challenge all the Hackers to think about >> testing in a different way. The tests in our code are used to give us >> confidence that the work we did is working as expected, this also makes it >> much easier to refactor out bad patterns or very complicated ones into >> something simple. A signal that our code is more complicated then it should >> is when we need to test some behavior and we end up with a Stubbing Hell or >> we need to test it End 2 End because it is to hard to isolate the part we >> want to test. In the other hand we should not test all functions and every >> class, because we might be coupling our tests to much to the implementation >> and that will have the contrary effect, and we will not be able to refactor >> and simply our code. >> Like everything in life there need to be a balance. >> > > I think that is very good advice, and I would also like to encourage all > the developers to think this way. However, I would also caution against > underestimating the importance of our feature tests. It is obviously > important to have confidence that our code is robust and functions > correctly at the unit level, but that doesn't mean that it all works > together as expected to provide the user functionality we desire. I think > the feature tests are critical in this regard; they protect us against > class of bug that might otherwise be missed without manual testing that we > strive to eliminate entirely. For the EDBers on the team, think of the > feature tests in terms of what we normally call integration testing; > ensuring that not only do the individual pieces work as they should, but > that they work together as they should. > > -- > Dave Page > Blog: http://pgsnake.blogspot.com > Twitter: @pgsnake > > EnterpriseDB UK: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > --001a11406f18cb30b205667256c5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello Dave,

Very well said, I didn't inte= nded to say that Feature Tests are not important, what I was saying is that= when we can do faster and more thorough tests we should take it. All the t= ests that we do are important to ensure that the software we produce is of = good quality.

Also the higher you go in the pyrami= d the more volatile the test are and more variables need to be taken into a= ccount when doing them.

Thanks
Joao

On Fri, Mar 2,= 2018 at 8:31 AM Dave Page <dpage@p= gadmin.org> wrote:
On Thu, Mar = 1, 2018 at 3:21 PM, Joao De Almeida Pereira <jdealmeidapereir= a@pivotal.io> wrote:
Hello Khushboo,
The patch runs successfu= lly in our CI with all tests passing.

I see the te= st that you created, and I do not understand why we need to create tests th= at do HTTP requests in order to check something that is executed against th= e database. What I was talking about in my previous email was having tests = that tested the function by itself.

=C2=A0
(Copied from:=C2=A0https://jfiaffe.files.wordpress.com/= 2014/09/tests-pyramid.png)

This is the Tes= ting Pyramid, there are a bunch of different drawings of it and ways to exp= lain it, but in broad stokes what is means is that we should have the major= ity of tests around a Unit (that are some disagreements in the community of= what a Unit is) and a very small amount of Manual testing. What Unit usual= ly means is piece of code, it can be a function, it can be a class or it ca= n even be a module, but is something self contained. In pgAdmin's case = the majority of our tests go around the Integration Layer because we are us= ing HTTP requests in order to executing queries in the database, so basical= ly we are doing tests end to end in the backend, and the cost time.

I do not want to held this patch back because of this, an= d I say this because I have minimal confidence with the tests that you crea= ted, that they would catch the majority of the problems, and hope that the = majority of the code is exercised by it.

Neverthel= ess I would like to challenge all the Hackers to think about testing in a d= ifferent way. The tests in our code are used to give us confidence that the= work we did is working as expected, this also makes it much easier to refa= ctor out bad patterns or very complicated ones into something simple. A sig= nal that our code is more complicated then it should is when we need to tes= t some behavior and we end up with a Stubbing Hell or we need to test it En= d 2 End because it is to hard to isolate the part we want to test. In the o= ther hand we should not test all functions and every class, because we migh= t be coupling our tests to much to the implementation and that will have th= e contrary effect, and we will not be able to refactor and simply our code.=
Like everything in life there need to be a balance.
<= /blockquote>
<= div class=3D"gmail_quote">
<= /div>

I think that is very good advice, and= I would also like to encourage all the developers to think this way. Howev= er, I would also caution against underestimating the importance of our feat= ure tests. It is obviously important to have confidence that our code is ro= bust and functions correctly at the unit level, but that doesn't mean t= hat it all works together as expected to provide the user functionality we = desire. I think the feature tests are critical in this regard; they protect= us against class of bug that might otherwise be missed without manual test= ing that we strive to eliminate entirely. For the EDBers on the team, think= of the feature tests in terms of what we normally call integration testing= ; ensuring that not only do the individual pieces work as they should, but = that they work together as they should.=C2=A0

--
Dave= Page
Blog: ht= tp://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: = http://www.enterp= risedb.com
The Enterprise PostgreSQL Company
--001a11406f18cb30b205667256c5--